Hello i really need help with this please. From Michael T. Heath - Scientific Co
ID: 2249445 • Letter: H
Question
Hello i really need help with this please.
From Michael T. Heath - Scientific Computing/ Chapter 3/ computer problem 3.4
i need to solve this problem using matlab, thankyou
3.4. (a) Solve the following least squares prob- lem using any method you like: 0.16 0.10 0.26 | 0.28 | . 3.31 2 1 | 2.02 1.29 2 (b) Now solve the same least squares problem again, but this time use the slightly perturbed right-hand side 0.271 b 0.25 3.33 (e) Compare your results from parts a and b Can you explain this difference?Explanation / Answer
a)
xa =
1
1
b)
xb =
7.0089
-8.3957
MATLAB CODE :
clc;
A=[0.16 0.10;0.17 0.11;2.02 1.29];
%-----------------PART a ----------------
ba=[0.26;0.28;3.31];
xa=(inv(A'*A))*(A'*ba);
%-----------------PART b -----------------
bb=[0.27; 0.25; 3.33];
xb=(inv(A'*A))*(A'*bb);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.