Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8.1 Enter the matrix M by > M = [1,3,-1,6;2,4,0,-1;0,-2,3,-1; -1,2,-5,1] and also the matrix [ -1 -3 1 2 -1 31 6 N =
8.1 Enter the matrix M by > M = [1,3,-1,6;2,4,0,-1;0,-2,3,-1; -1,2,-5,1] and also the matrix [ -1 -3 1 2 -1 31 6 N = 1 4 -1 1 2 -1 2] Multiply M and N using M * N. Can the order of multiplication be switched? Why or why not? Try it to see how MATLAB reacts. 8.2 By hand, calculate Av, AB, and BA for: 1 7 co A= 2 -2 -1 4 1 -1 -1 9 0 B= 0 1 -1 -1 0 -2 -1 2 0 v= -1 8.3 Check the results using MATLAB. Think about how fast computers are. Turn in your hand work. (a) Write a well-commented MATLAB function program myinvcheck that makes a n x n random matrix (normally distributed, A = randn(n,n)), calculates its inverse (B = inv(A)), multiplies the two back together, calculates the residual (difference between B and eye(n)), and returns the scalar residual (norm of the difference). (b) Write a well-commented MATLAB script program myinvcheckplot that calls myinvcheck for n = 10, 20,40,..., 2'10 for some moderate i, records the results of each trial, and plots the scalar residual versus n using a log plot. (See help loglog.) What happens to the scalar residual as n gets big? Turn in the programs, the plot, and a very brief report on the results of your experiments. (Do not include any large random matrices.)
Step 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