Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could someone show me the MATLAB code for the parts to this problem so i can run it myself? Both would be great, but #8
Could someone show me the MATLAB code for the parts to this problem
so i can run it myself? Both would be great, but #8 is the main one i want to do Thank you very much!
7. Manipulate a matrix: Do the following operations on matrix G created above in Problem 6. (a) Extract the 3 x 3 submatrix of G consisting of columns 1 through 3 and rows 1 through 3 and store it in the matrix H, that is, create a matrix i 0-31 H = 0 1 1 1-5 -3 1] by extracting the appropriate rows and columns from the matrix G. (b) Create the matrix e obtained from H by replacing H2 = 0 by 5. Do not enter E explicitly. Hint: enter first E=H; to create a copy of the matrix H and then manipulate the matrix E. The resulting matrix should be i 0-31 E= 5 1 1 1-5 -3 1] (c) Create the matrix F obtained by deleting the third column of the matrix H. Do not enter F explicitly. (d) What happens if you type G(:,:) and hit return? Do not include the output in your lab report, but include a statement describing the output in words. What happens if you type G(:) and hit return? Do not include the output in your lab report, but include a statement describing the output in words. (e) What happens if you type G(5,6) and hit return? Explain. (f) What happens if you type max(G)? Explain. What happens if you type sum(G)? Explain. (g) What happens if you type G(G>3) and hit return? Can you explain how MATLAB got that answer? What happens if you type G(G>3) = 500 and hit return? Can you explain how MATLAB got that answer? 8. Perform row operations: The three elementary row operations can be performed in MATLAB using the following commands Type I: A([i,j], :)=A([j,i],:) interchanges row i and row j Type II: Ali, :)=2*A(i,:) multiplies row i by a Type III: A(i,:)=A(i, :)+ q*A(j,:) multiplies row j by a and adds it to row i Enter the following matrix: [ 4 2 3 1 A= -8 -7 -2 ( 12 -9 34 Perform row operations in MATLAB that reduce the matrix A to Row Echelon Form. Use format rat. 7. Manipulate a matrix: Do the following operations on matrix G created above in Problem 6. (a) Extract the 3 x 3 submatrix of G consisting of columns 1 through 3 and rows 1 through 3 and store it in the matrix H, that is, create a matrix i 0-31 H = 0 1 1 1-5 -3 1] by extracting the appropriate rows and columns from the matrix G. (b) Create the matrix e obtained from H by replacing H2 = 0 by 5. Do not enter E explicitly. Hint: enter first E=H; to create a copy of the matrix H and then manipulate the matrix E. The resulting matrix should be i 0-31 E= 5 1 1 1-5 -3 1] (c) Create the matrix F obtained by deleting the third column of the matrix H. Do not enter F explicitly. (d) What happens if you type G(:,:) and hit return? Do not include the output in your lab report, but include a statement describing the output in words. What happens if you type G(:) and hit return? Do not include the output in your lab report, but include a statement describing the output in words. (e) What happens if you type G(5,6) and hit return? Explain. (f) What happens if you type max(G)? Explain. What happens if you type sum(G)? Explain. (g) What happens if you type G(G>3) and hit return? Can you explain how MATLAB got that answer? What happens if you type G(G>3) = 500 and hit return? Can you explain how MATLAB got that answer? 8. Perform row operations: The three elementary row operations can be performed in MATLAB using the following commands Type I: A([i,j], :)=A([j,i],:) interchanges row i and row j Type II: Ali, :)=2*A(i,:) multiplies row i by a Type III: A(i,:)=A(i, :)+ q*A(j,:) multiplies row j by a and adds it to row i Enter the following matrix: [ 4 2 3 1 A= -8 -7 -2 ( 12 -9 34 Perform row operations in MATLAB that reduce the matrix A to Row Echelon Form. Use format ratStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started