Matrices in the appropriate position create the

• 10

This preview shows page 10 out of 10 pages.

matrices in the appropriate position. Create the matrix using submatricesA,B,C,zerosandeye(that is, you are not allowed to enter the numbers explicitly).G=3-3-4-3-110-3-54-150100010-6-200001-2-37.Manipulate a matrix:Do the following operations on matrixGcreated above inProblem 6.(a) Extract the 3×3 submatrix ofGconsisting of columns 3 through 5 and rows 1through 3 and store it in the matrixH, that is, create a matrixH=-4-3-14-15010by extracting the appropriate rows and columns from the matrixG.(b) Create the matrixEobtained fromHby replacingH31= 0 by 5.Do not enterEexplicitly.Hint:enter firstE=H;to create a copy of the matrixHand thenmanipulate the matrixE. The resulting matrix should beE=-4-3-14-15510(c) Create the matrixFobtained by deleting the third column of the matrixH. Do notenterFexplicitly.(d) What happens if you typeG(:,:)and hit return?Do not include the output inyour lab report, but include a statement describing the output in words.What happens if you typeG(:)and hit return? Do not include the output in yourlab report, but include a statement describing the output in words.(e) What happens if you typeG(7,3)and hit return? Explain.(f) What happens if you typemax(G)? Explain.What happens if you typesum(G)?Explain.(g) What happens if you typeG(G>2)and hit return? Can you explain how MATLABgot that answer? What happens if you typeG(G>2) = 400and hit return? Can youexplain how MATLAB got that answer?8.Perform row operations:The three elementary row operations can be performed inMATLAB using the following commandsType I:A([i,j],:)=A([j,i],:)interchanges rowiand rowjType II:A(i,:)=α*A(i,:)multiplies rowibyαType III:A(i,:)=A(i,:)+α*A(j,:)multiplies rowjbyαand adds it to rowiEnter the following matrix:A=335-6-10-89-1529Perform row operations in MATLAB that reduce the matrixAto Row Echelon Form.Useformat rat.THIS CONTENT IS PROTECTED AND MAY NOT BE SHARED, UPLOADED, SOLD OR DISTRIBUTED2019 v22 [email protected] School of Mathematical and Statistical Sciences, Arizona State University10