Curve Fitting

ap=polyfit(t,Y,1) ap =-0.5017 2.1098. You should notice that the first element in vector ap is the coefficient of the highest degree term. This is the convention used by Matlab in any polynomial functions. The experimental data and the best fitted line can be plotted by the following Matlab statements >> ycal=polyval(ap,t) ycal = ................
................