Question: Make sure its in MATLAB code. 4. You should hand in only your MATLAB output/answers for le and f a. Create a scatter plot for
4. You should hand in only your MATLAB output/answers for le and f a. Create a scatter plot for the function y sin(x), x1:0.3:10. b. Use polyfit to fit a 2-degree polynomial to the curve. c. Use polyfit to fit a 4-degree polynomial to the curve. d. Use polyfit to fit a 5-degree polynomial to the curve. e. On the same MATLAB figure, plot the curves in (b)-(d) along with the scatter plot in (a). Add a legend to your figure. f. Determine the polynomial that gives the best fit for the function y sin(x)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
