Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB's qr command, which we introduced in Exercise 3.2.49, can also be used to compute QR decompositions of non-square matricies. Please answer part (b) of
MATLAB's qr command, which we introduced in Exercise 3.2.49, can also be used to compute QR decompositions of non-square matricies. Please answer part (b) of Exercise 3.3.10.
Exercise 3.3.10 MATLAB's qr command, which we introduced in Exercise 3.2.49, can also be used to compute QR decompositions of non-square matrices. (a) Try out the following commands, for example. n = 6 m = 3 A = randn (n, m) [Q,R] = gr (A) Q' *Q norm (eye (m) -Q'*Q) norm (A-Q*R) In the interest of convenience, MATLAB returns Q in assembled form. (b) Write a short MATLAB script (m-file) that solves least squares problems using the qr command. (The submatrix R can be accessed by writing R (1:m, 1:m) or R (1:m, :), for example.) Use your script to solve the least squares prob- lems in parts (a) and (b) of Exercise 3.3.9. This is not the simplest way to solve least squares problems using MATLAB. Recall from Exercise 3.1.5 that the command x = A\b works as well. This gives you a simple way to check your work. Exercise 3.3.10 MATLAB's qr command, which we introduced in Exercise 3.2.49, can also be used to compute QR decompositions of non-square matrices. (a) Try out the following commands, for example. n = 6 m = 3 A = randn (n, m) [Q,R] = gr (A) Q' *Q norm (eye (m) -Q'*Q) norm (A-Q*R) In the interest of convenience, MATLAB returns Q in assembled form. (b) Write a short MATLAB script (m-file) that solves least squares problems using the qr command. (The submatrix R can be accessed by writing R (1:m, 1:m) or R (1:m, :), for example.) Use your script to solve the least squares prob- lems in parts (a) and (b) of Exercise 3.3.9. This is not the simplest way to solve least squares problems using MATLAB. Recall from Exercise 3.1.5 that the command x = A\b works as well. This gives you a simple way to check your work
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