为什么函数 lsqcurvefit 在 Matlab 2015b 中似乎不起作用?

Why does the function lsqcurvefit not seem to work in Matlab 2015b?

我使用的是 Matlab 2015b,函数 lsqcurvefit 似乎不起作用。其实得到如下错误信息

Diagnostic Information:
Feature: Optimization_Toolbox
License path:
/home/username/.matlab/R2015b_licenses:/.netmount/app/MATLAB/R2015b/licenses/license.dat:/.netmount/app/MATLAB/R2015b/licenses/license.lic:/.netmount/app/MATLAB/R2015b/licenses/network.lic

Licensing error: -18,147.

Error in test (line 7)
x = lsqcurvefit(fun,x0,xdata,ydata)

下面的脚本。请注意,当我用 lsqcurvefit 注释掉最后一行时,不会出现任何错误消息。有趣的是,该脚本在另一台装有 Matlab 2017a 的机器上运行良好。

xdata = [0.9 1.5 13.8 19.8 24.1 28.2 35.2 60.3 74.6 81.3];
ydata = [455.2 428.6 124.1 67.3 43.2 28.1 13.1 -0.4 -1.3 -1.5];

fun = @(x,xdata)x(1)*exp(x(2)*xdata);

x0 = [100,-1];
x = lsqcurvefit(fun,x0,xdata,ydata)

有什么想法吗?谢谢

命令 lsqcurvefit 不是 MATLAB 的一部分,它是附加产品优化工具箱的一部分。看起来你的 17b 安装有那个产品,但你的 15b 安装没有,所以你收到一个错误,告诉你你没有该产品的许可证。