Question

) For the data below a) Write a MATLAB function to do a linear regression using least squares fit to calculate the slope and intercept of the fitted line. Plot the data and the straight line. Evaluate the goodness of the fit. b) Repeat part (a), but use polynomial regression to fit a parabola to the data. Compare the results with those of (a).

Fig: 1

Fig: 2

Fig: 3

Fig: 4