Answered step by step
Verified Expert Solution
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 qrB
The columns of Q form an orthonormal basis for V Let's give them their own names:
x Q:
y Q:
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 dotxdx dotydy
The resulting vector v here is projVd. Remember to include all your input and output for this procedure in your writeup
Now solve the equation Bc projVd v by typing in the following:
c Bv
Check that your answer is correct by entering
Bc 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 builtin 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 lscovB d eye
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started