I have a sets of data [x,y] that I want to fit with a function F(v,x) where v contains six free parameters.
I found the best fitted curve by cftool for this data set (polynomial degree 5):
but the result is different when I use lsqcurvefit.
fun = @(v,x)v(1)*x.^5 + v(2)*x.^4 + v(3)*x.^3 + v(4)*x.^2 + v(5)*x + v(6);
times = linspace(x(1),x(end));
this is the result:
It seems lsqurvefit did not fitted the curve to the points.
any idea that why it does not work for me?