I have 5 input variables organized in a table:
dt, sinday, cosday, sinhour, coshour
The dependent variable is Q (number of observations).
I wrote the following script:
tbl = table(dt,sinhour,coshour,sinday,cosday);
beta0 = [0;0;0;0;0;0];
modelfun = @(b,x) b(1) + b(2)*dt + b(3)*sinhour + b(4)*coshour + b(5)*sinday + b(6)*cosday;
md1 = fitnlm(tbl,Q,modelfun,beta0);
But it is giving the following error message while running:
Error using internal.stats.parseArgs (line 42)
Wrong number of arguments.
Error in NonLinearModel.fit (line 1379)
[coefNames,predictorVars,responseVar,weights, ...
Error in fitnlm (line 94)
model = NonLinearModel.fit(X,varargin{:});
Error in nlmfitoccu (line 57)
md1 = fitnlm(tbl,Q,modelfun,beta0);
I am not been able to sort it out.