Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions