Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Having trouble with homework for MATLAB I can't get the sinusoidal values to show in the plot for part a and part b for this
Having trouble with homework for MATLAB I can't get the sinusoidal values to show in the plot for part a and part b for this question. Thanks!
2) [5pts] Give an analytic formula for parameters B and k as a function of the data points (x,yi) i-1.N. HINT: use the linear fit expressions for a0 and al you have obtained in 1) Problem. 2- Generalize Least-squares-30pts A data set (x,.y,). i-1.N, is given by X - linspace (0,10,100) Y2*sin (X+0.5 i) 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, two best-fit parameters -amplitude A and phase e- so that the data can be fitted by the function y A sin(x + e) (1). NAME YOUR CODE MyFitl.m the 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 2) [5pts] Give an analytic formula for parameters B and k as a function of the data points (x,yi) i-1.N. HINT: use the linear fit expressions for a0 and al you have obtained in 1) Problem. 2- Generalize Least-squares-30pts A data set (x,.y,). i-1.N, is given by X - linspace (0,10,100) Y2*sin (X+0.5 i) 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, two best-fit parameters -amplitude A and phase e- so that the data can be fitted by the function y A sin(x + e) (1). NAME YOUR CODE MyFitl.m the 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
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