Question: 3. (Computational) Write a single Matlab function with interface function (x) LeastSquaresSolve(A,b) in a file named Least SquaresSolve.m or Least SquaresSolve.py, that calls the built-in

 3. (Computational) Write a single Matlab function with interface function (x)
LeastSquaresSolve(A,b) in a file named Least SquaresSolve.m or Least SquaresSolve.py, that calls

3. (Computational) Write a single Matlab function with interface function (x) LeastSquaresSolve(A,b) in a file named Least SquaresSolve.m or Least SquaresSolve.py, that calls the built-in 'thin' QR factorization routine in your environment. If the matrix does not have full column rank, return an error message. Otherwise, use the thin QR factorization to solve the least-squares problem AF = 6, and return the solution. Write a Matlab/Python script prob3.m or prob3.py that performs the following tasks for each (m,n) pair in {(120,60), (240, 120), (480, 240). (960, 480): (a) Construct a random matrix A ERM (b) Construct a random 'true' solution vector itru ER". (c) Compute the corresponding right-hand side vector 6 = Aires (d) Call your Least SquaresSolve function above to compute the vector d'or (e) Set up the normal equations, M = A' A and C = A', and use the built-in linear solver in your computing environment to solve the linear system M (1Measure the relative error in both solutions, liberu - inhell and and output these values to the screen, 3. (Computational) Write a single Matlab function with interface function (x) LeastSquaresSolve(A,b) in a file named Least SquaresSolve.m or Least SquaresSolve.py, that calls the built-in 'thin' QR factorization routine in your environment. If the matrix does not have full column rank, return an error message. Otherwise, use the thin QR factorization to solve the least-squares problem AF = 6, and return the solution. Write a Matlab/Python script prob3.m or prob3.py that performs the following tasks for each (m,n) pair in {(120,60), (240, 120), (480, 240). (960, 480): (a) Construct a random matrix A ERM (b) Construct a random 'true' solution vector itru ER". (c) Compute the corresponding right-hand side vector 6 = Aires (d) Call your Least SquaresSolve function above to compute the vector d'or (e) Set up the normal equations, M = A' A and C = A', and use the built-in linear solver in your computing environment to solve the linear system M (1Measure the relative error in both solutions, liberu - inhell and and output these values to the screen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!