fitnlm not working on mac

2 次查看(过去 30 天)
Stephan Koehler
Stephan Koehler 2014-6-24
%I simply copied this sample script for fitnlm
load carbig
ds = dataset(Horsepower,Weight,MPG);
modelfun = @(b,x)b(1) + b(2)*x(:,1).^b(3) + ...
b(4)*x(:,2).^b(5);
beta0 = [-50 500 -1 500 -1];
mdl = fitnlm(ds,modelfun,beta0)
%and got this error:
Error using nlinfit
Too many input arguments.
Error in NonLinearModel/fitter (line 1118)
[model.Coefs,~,J_r,model.CoefficientCovariance,model.MSE,model.ErrorModelInfo,~]
= ...
Error in classreg.regr.FitObject/doFit
(line 220)
model = fitter(model);
Error in NonLinearModel.fit (line 1421)
model = doFit(model);
Error in fitnlm (line 94)
model = NonLinearModel.fit(X,varargin{:});
  1 个评论
Geoff Hayes
Geoff Hayes 2014-6-24
It could be that the sample script you copied (from where?) is valid for a different version of the fitnlm function. When you type doc fitnlm (in the Command Window) does the help details include an example similar to what you have tried already?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by