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

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

3. (Computational) Write a single Matlab function with interface function (x) LeastSquaresSolve (A,b) in a file named LeastSquaresSolve.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 e Rmx (b) Construct a random 'true' solution vector Etrue ER". (c) Compute the corresponding right-hand side vector 8 = Aires (d) Call your Least SquaresSolve function above to compute the vector ilgr (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 in (1) Measure the relative error in both solutions, and litru - nel Prell 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 LeastSquaresSolve.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 e Rmx (b) Construct a random 'true' solution vector Etrue ER". (c) Compute the corresponding right-hand side vector 8 = Aires (d) Call your Least SquaresSolve function above to compute the vector ilgr (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 in (1) Measure the relative error in both solutions, and litru - nel Prell 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!