matlab中使用inline 和 nlinfit 报错!!!!!!!
代码:myfunc=inline('a(1)/abs(x)+a(2)/sqrt(abs(x))+a(3)+a(4)*sqrt(abs(x))+a(5)*abs(x)','...
代码:
myfunc=inline('a(1)/abs(x)+a(2)/sqrt(abs(x))+a(3)+a(4)*sqrt(abs(x))+a(5)*abs(x)','a','x');
a=nlinfit(x,y,myfunc,[0.5 0.1 0.2 0.3 0.4]);
错误:
??? Error using ==> nlinfit at 113
Error evaluating inline model function.
Error in ==> allan at 32
a=nlinfit(x,y,myfunc,[0.5 0.1 0.2 0.3 0.4]);
Caused by:
Error using ==> inlineeval at 15
Error in inline expression ==>
a(1)/abs(x)+a(2)/sqrt(abs(x))+a(3)+a(4)*sqrt(abs(x))+a(5)*abs(x)
Matrix dimensions must agree. 展开
myfunc=inline('a(1)/abs(x)+a(2)/sqrt(abs(x))+a(3)+a(4)*sqrt(abs(x))+a(5)*abs(x)','a','x');
a=nlinfit(x,y,myfunc,[0.5 0.1 0.2 0.3 0.4]);
错误:
??? Error using ==> nlinfit at 113
Error evaluating inline model function.
Error in ==> allan at 32
a=nlinfit(x,y,myfunc,[0.5 0.1 0.2 0.3 0.4]);
Caused by:
Error using ==> inlineeval at 15
Error in inline expression ==>
a(1)/abs(x)+a(2)/sqrt(abs(x))+a(3)+a(4)*sqrt(abs(x))+a(5)*abs(x)
Matrix dimensions must agree. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询