Question: Please code in Matlab. I will report spam answers. Problem. 2- Generalize Least-squares-30pts- A data set (xi.yi), i-1..N, is given by Xlinspace (0,10,100); Y 2

Please code in Matlab. I will report spam answers. Please code in Matlab. I will report spam answers. Problem. 2- Generalize

Problem. 2- Generalize Least-squares-30pts- A data set (xi.yi), i-1..N, is given by Xlinspace (0,10,100); Y 2 sin (X+0.5*pi) Assuming you didn't know how the data points were generated, you would like to approximate the data set by a sinusoidal function 1) [10 pts] Using the generalized least-square matrix formulation derived in class, determine the two best-fit parameters-amplitude A and phase - so that the data can be fitted by the function y=A-sin(x+O) (1 ). NAME YOUR CODE MyFitl.m HINT: using trigonometry, show that this fit function y can be rewritten as a linear parameter fit: y al sin(x) + a2 cos(x) (17) 2) [5 pts] Plot on the same graph the data points and the best fit function (over a more finely sampled horizontal axis to have a smooth curve). Comment on the accuracy of the fit NAME YOUR CODE MyFit2.m Problem. 2- Generalize Least-squares-30pts- A data set (xi.yi), i-1..N, is given by Xlinspace (0,10,100); Y 2 sin (X+0.5*pi) Assuming you didn't know how the data points were generated, you would like to approximate the data set by a sinusoidal function 1) [10 pts] Using the generalized least-square matrix formulation derived in class, determine the two best-fit parameters-amplitude A and phase - so that the data can be fitted by the function y=A-sin(x+O) (1 ). NAME YOUR CODE MyFitl.m HINT: using trigonometry, show that this fit function y can be rewritten as a linear parameter fit: y al sin(x) + a2 cos(x) (17) 2) [5 pts] Plot on the same graph the data points and the best fit function (over a more finely sampled horizontal axis to have a smooth curve). Comment on the accuracy of the fit NAME YOUR CODE MyFit2.m

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!