Hi all, I am having troubles in using fillnm. Below an example:clear allx=[0:0.01:10];y=x.^2;modelfun=@(x)(x.^2);beta0=1;mdl=fitnlm(x,y,modelfun,beta0);
Unfortunately, I get the following error:
Error using classreg.regr.NonLinearFormula (line 225)The model function must accept two arguments.Error in NonLinearModel/createFormula (line 1643) formula = classreg.regr.NonLinearFormula(modelDef,coefNames,predictorVars,responseVar,varNames,ncoefs);Error in NonLinearModel.fit (line 1397) model.Formula = NonLinearModel.createFormula(supplied,modelDef,X,ncoefs,coefNames, ...Error in fitnlm (line 94)model = NonLinearModel.fit(X,varargin{:});
Why do I get this error?
Thanks.
Best regards,
Pietro
Best Answer