====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2016:math445:exam1sample [2016/03/01 12:44] gibson |
gibson:teaching:spring-2016:math445:exam1sample [2016/03/02 12:38] (current) gibson |
||
---|---|---|---|
Line 8: | Line 8: | ||
**Problem 2:** (slightly tricky) Given a matrix $A$, write one line of Matlab code that convert the $j$th column of $A$ into a row vector and assign it to the variable $x$. | **Problem 2:** (slightly tricky) Given a matrix $A$, write one line of Matlab code that convert the $j$th column of $A$ into a row vector and assign it to the variable $x$. | ||
- | **Problem 3:** (pretty straightforward) Given a vector $v$, write one or two lines of Matlab code that would return all the odd-numbered elements of $v$. | + | **Problem 3:** (pretty straightforward) Given a vector $v$, write one or two lines of Matlab code that would return all the odd-numbered elements of $v$. (By "odd-numbered elements", I mean the elements with odd indices, e.g. $v_1, v_3, \ldots$.) |
**Problem 4:** (moderate) Write Matlab code that defines a function named ''mysin'' that computes $\sin(x)$ using the truncated power series | **Problem 4:** (moderate) Write Matlab code that defines a function named ''mysin'' that computes $\sin(x)$ using the truncated power series | ||
\begin{equation*} | \begin{equation*} | ||
- | \sin(x) \doteq \sum_{n=0}^{10} -1^{2n+1} \frac{x^{2n+1}}{(2n+1)!} | + | \sin(x) \doteq \sum_{n=0}^{10} -1^n \frac{x^{2n+1}}{(2n+1)!} |
\end{equation*} | \end{equation*} | ||
+ | |||
+ | **Note: an earlier version of this problem had an error in the Taylor series of** $\sin x$. | ||
+ | |||
**Problem 5:** (straightforward) Write Matlab code that would solve the system of equations. | **Problem 5:** (straightforward) Write Matlab code that would solve the system of equations. |