For the linear system Ax = b, with A and b defined as
A= [1 2 -1; 2 3 1; -1 -1 -2; 3 5 0]
B= [1; 0; 1; 0]
(a) By hand, calculate the pseudoinverse A+
(b) Use the pseudoinverse to calculate a least squares solution for the
system.
(c) Calculate the least squares solution to the system in MATLAB,
using mldivide (i.e., A\b).
(d) Calculate the size of the error e from each solution, and compare the size of each least squares solution xˆ. How do the errors and sizes compare?
(a)
(b)
(c)
define A and B as shown in question. then use the mldivide function as shown below:
(d)
Get Answers For Free
Most questions answered within 1 hours.