matlab 最小二乘拟合
-1-25来自ip:12.12.148.103的网友咨询
浏览量:157
问题补充:
matlab 最小二乘拟合
这是m文件
function y=nihe4(p,x)
y=p(1)*x+p(2)*x^2*exp(-p(3)*x)+p(4);
主程序:
x=0.1:0.1:1;
>> y=[2.3201,2.6470,2.9707,3.2885,3.6008,3.9090,4.2147,4.5191,4.8232,5.1275];
>> p=nlinfit(x,y,'nihe4',ones(1,4));
下面会出现这个
Caught std::exception Exception message is:
Message Catalog was not loaded from the file.Please check file location,format or contents
然后我输入
>> a=p(1)
a =
2.3200
>> b=p(2)
b =
-0.8203
>> c=p(3)
Attempted to access p(3); index out of bounds because numel(p)=2.
这是怎么回事?
如果觉得《matlab 中最小二乘拟合 matlab 最小二乘拟合》对你有帮助,请点赞、收藏,并留下你的观点哦!