====== 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-2015:math445:lab2 [2015/01/28 12:34] gibson |
gibson:teaching:spring-2015:math445:lab2 [2015/01/28 12:40] (current) gibson |
||
---|---|---|---|
Line 3: | Line 3: | ||
---- | ---- | ||
- | **Problem 1.** Show how to create the following vectors in Matlab three different ways, | + | **Problem 1.** Creation of vectors. Show how to create the following vectors in Matlab three different ways, |
using square brackets, ''linspace,'' and colon syntax. | using square brackets, ''linspace,'' and colon syntax. | ||
Line 32: | Line 32: | ||
---- | ---- | ||
- | **Problem 2:** subvectors. Given the $x$ vector of problem 1d, | + | **Problem 2:** Extracting and assigning subvectors. Given the $x$ vector of problem 1d, |
**(a)** What is the value of the 73th element of $x$? | **(a)** What is the value of the 73th element of $x$? | ||
Line 47: | Line 47: | ||
---- | ---- | ||
- | **Problem 3.** | + | **Problem 3.** Creation of matrices, extracting and assigning elements and subvectors. |
**(a)** Create the matrix A | **(a)** Create the matrix A | ||
\begin{eqnarray*} | \begin{eqnarray*} | ||
Line 64: | Line 65: | ||
---- | ---- | ||
- | **Problem 4.** | + | **Problem 4. Extracting and assigning submatrices.** |
**(a)** Create a $5 \times 5$ matrix A of zeros. | **(a)** Create a $5 \times 5$ matrix A of zeros. | ||
Line 78: | Line 80: | ||
**(e)** What is the fourth row of $A$? | **(e)** What is the fourth row of $A$? | ||
+ | **(f)** What is the central $3 \times 3$ submatrix of $A$? |