Question: write a MATLAB function which computes the projection of b onto the Column Space of an m n matrix A. function [p, z] = proj(A,b)

write a MATLAB function which computes the projection of b onto the Column Space of an m n matrix A.

function [p, z] = proj(A,b)

write a MATLAB function which computes the projection of b onto theColumn Space of an m n matrix A. function [p, z] =proj(A,b) In this exercise, you will write a MATLAB function [p, z]

In this exercise, you will write a MATLAB function [p, z] -proj(A,b) which computes the projection of b onto the Column Space of an mxn matrix A. Your program should allow a possibility that the columns of A are not linearly independent. In order for the algorithm to work, you will need to create a basis for Col A * *A basis can be produced with the function shrink that you should create in MATLAB Here is the code: function B = shrink(A) format compact, , pivot] rref(A); B A(: , pivot); Also, to save a space in your file, all input vectors must be row vectors and you can use a AB command transpose to make the adjustments for the outputs to be row vectors as well. Note: the MATLAB command transpose(X) is the same as X' Recall: The vector p is the orthogonal projection of a vector b Col A onto Col A, when the columns of A are linearly independent, if and only if p -Ai, where i is the least-squares solution of Ax-b, or equivalently, the unique solution of the normal equations In this exercise, you will write a MATLAB function [p, z] -proj(A,b) which computes the projection of b onto the Column Space of an mxn matrix A. Your program should allow a possibility that the columns of A are not linearly independent. In order for the algorithm to work, you will need to create a basis for Col A * *A basis can be produced with the function shrink that you should create in MATLAB Here is the code: function B = shrink(A) format compact, , pivot] rref(A); B A(: , pivot); Also, to save a space in your file, all input vectors must be row vectors and you can use a AB command transpose to make the adjustments for the outputs to be row vectors as well. Note: the MATLAB command transpose(X) is the same as X' Recall: The vector p is the orthogonal projection of a vector b Col A onto Col A, when the columns of A are linearly independent, if and only if p -Ai, where i is the least-squares solution of Ax-b, or equivalently, the unique solution of the normal equations

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!