
Modeling Data
X = [ones(size(tdata)) cos((2* pi/12)*(tdata-7))];
s_coeffs = X\c3;
figure
plot(c3,'o-')
hold on
tfit = (1:0.01:24)';
yfit = [ones(size(tfit)) cos((2*pi/12)*(t fit- 7))]*s_coeffs;
plot(tfit,yfit,'r-','LineWidth',2)
legend('Data','Sinusoidal Fit','Location', 'NW' )
Use the MATLAB lscov function to compute statistics on the fit, such as
estimated standard e rrors of the coefficients and the mean squared error:
[s_coeffs,stdx,mse] = lscov(X,c3)
s_coeffs =
65.5833
5-21
Comentários a estes Manuais