【发布时间】:2018-11-18 20:17:55
【问题描述】:
我有下表,名为“test”:
0.0037071 0.5
0.015203 1
0.035039 1.5
0.062272 2
0.093988 2.5
0.12776 3
0.16291 3.5
0.19991 4
0.24002 4.5
0.28574 5
0.34696 5.5
0.47879 6
1.8882 6.1125
现在我想使用 matlab 拟合非线性函数:
modelfun = @(b,x)erf(b(1)*x)./b(2) + b(3);
beta0 = [0, 0, 0];
mdl = fitnlm(test,modelfun,beta0)
但我收到以下错误:
Error using nlinfit (line 247)
No usable observations after removing NaNs in Y and in the result of evaluating MODELFUN at the initial value BETA0.
我该如何解决这个问题? (以及如何获得用于绘图的最终拟合非线性函数?)
【问题讨论】:
标签: matlab