"nls = fitoptions('Method','LinearLeastSquares');
gaussT = fittype('a * x.^2 + b * x + c','options',nls);
[gaussNLS gaussNLSgof] = fit(data(LV:RV,1), data(LV:RV,2),
gaussT)"
and error I get
"??? No appropriate method or public field startpoint for
class curvefit.llsqoptions.
Error in ==> fit at 316
start = options.startpoint;
Error in ==> CurveFit>Calculate_Callback at 236
[gaussNLS gaussNLSgof] = fit(data(LV:RV,1),
data(LV:RV,2), gaussT)"
but if I set Startpoint
"nls=fitoptions('Method','LinearLeastSquares','Startpoint',[1
1 1]);
gaussT = fittype('a * x.^2 + b * x + c','options',nls);
[gaussNLS gaussNLSgof] = fit(data(LV:RV,1), data(LV:RV,2),
gaussT)"
I get error
"??? There is no 'Startpoint' property in the 'llsqoptions'
class.
Error in ==> fitoptions at 195
set(f,varargin{:});
Error in ==> CurveFit>Calculate_Callback at 234
nls =
fitoptions('Method','LinearLeastSquares','Startpoint',[1 1 1]);"
What am I doing wrong?
Is there any example of LinearLeastSquares fit?
Thanks!
andrej
islinear assumes that all custom models specified by the fittype function using the syntax ftype = fittype('expr') are nonlinear models. To create a linear model with fittype that will be recognized as linear by islinear (and, importantly, by the algorithms of fit), use the syntax ftype = fittype({'expr1','expr2',...,'exprn'}).
Peter