![]() |
请帮忙看看这个matlab 自定义函数非线性拟合的代码有什么问题?谢谢
想要调用matlab的Psi函数进行相关的非线性拟合,在已经导入x和y数据后,我写了以下代码
mf=@(p,x)(1.5*(log(p(1)*x)+psi(1/p(1)/x+0.5))-0.5*(log(p(2)*x)+psi(1/p(2)/x+0.5))); P=[1;1]; Pc=nlinfit(x,y,mf,P); 但是编译时提示以下错误,请高手帮忙看看哪里的问题,如何改 谢谢 Error using nlinfit (line 121) Error evaluating model function '@(p,x)(1.5*(log(p(1)*x)+psi(1/p(1)/x+0.5))-0.5*(log(p(2)*x)+psi(1/p(2)/x+0.5)))'. Error in nonlinefit (line 3) Pc=nlinfit(x,y,mf,P); Caused by: Error using + Matrix dimensions must agree. |
所有时间均为北京时间。现在的时间是 14:49。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.