User Tools

Site Tools


gibson:teaching:spring-2015:math445:lab2

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

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.  ​
  
 **(b)** Assign the upper-left $2 \times 3$ submatrix of A to **(b)** Assign the upper-left $2 \times 3$ submatrix of A to
 +\begin{eqnarray*}
 \left[ \begin{array}{rrr} 1 & -4 & 3 \\  6 & 2 & 1 \end{array} \right] \left[ \begin{array}{rrr} 1 & -4 & 3 \\  6 & 2 & 1 \end{array} \right]
 +\end{eqnarray*}
  
 **%%(c)%%** Assign ones to the bottom-right $3 \times 3$ submatrix of A. **%%(c)%%** Assign ones to the bottom-right $3 \times 3$ submatrix of A.
Line 76: 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$?
gibson/teaching/spring-2015/math445/lab2.1422477248.txt.gz · Last modified: 2015/01/28 12:34 by gibson