Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Enter the matrix B and the vector d into MATLAB. To compute projVd, we must first find an orthonormal basis for V . For this,

Enter the matrix B and the vector d into MATLAB. To compute projVd, we must first find an orthonormal basis for V. For this, we use the qr() command:
>>[Q, R]= qr(B,0)
The columns of Q form an orthonormal basis for V. Let's give them their own names:
>> x = Q(:,1)
>> y = Q(:,2)
Now we're ready to compute projVd. To do this, we add up the projections of d onto each element in our orthonormal basis, like so:
>> v = dot(x,d)*x + dot(y,d)*y
The resulting vector v here is projVd. Remember to include all your input and output for this procedure in your write-up.
Now solve the equation Bc = projVd = v by typing in the following:
>> c = B\v
Check that your answer is correct by entering
>> B*c - v
Make sure the answer is zero. (Keep in mind that MATLAB may return a very small number instead of zero due to rounding errors.)
Now let's compare the answer we just found to what MATLAB gives us when we run the built-in least squares algorithm named lscov. To use it, we must specify three parameters: the matrix B, the vector d, and a covariance matrix X, which we won't worry about in this course. Type in the following command:
>> cl = lscov(B, d, eye(5))
How does your answer to this part compare to your previous answer?

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_2

Step: 3

blur-text-image_3

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

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions