I am trying to make a nonlinear regression model of the attached csv file. I used the following code:
if truedata=readtable('ban1.csv')sea=data(:,1)sst=data(:,2)at=data(:,3)X = [sst,at];y = sea;modelfun = @(b,x)b(1) + b(2)*x(:,1).^b(3) + ... b(4)*x(:,2).^b(5)beta0 = [100 100 100 100 100];mdl = fitnlm(X,y,modelfun,beta0) % code
end
I am getting the following errors:
Error using internal.stats.parseArgs (line 42) Wrong number of arguments.
Error in NonLinearModel.fit (line 1385) internal.stats.parseArgs(paramNames, paramDflts, otherArgs{:});
Error in fitnlm (line 99) model = NonLinearModel.fit(X,varargin{:});
Would be grateful if someone can help me, if possible with code. I would also like to know where I am going wrong.
Thank you
Best Answer