MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 新手求助—函数调用方面的问题 (https://www.labfans.com/bbs/showthread.php?t=12073)

youyubobo 2010-09-13 10:22

新手求助—函数调用方面的问题
 
这是我主程序的一部分,x(:,1)是ode45求出来的一组数,t_T和t_0也都赋值了,运行过程中fzero调用dF出错,但我不知道怎么改正,请求高手指点,谢谢!!
x_1=poly2sym(x(:,1),'t');
TL=(t_T-t_0);
dF=0;
F=0;
for ni=1:5
syms t
ani=2.*int(x_1.*cos(2.*ni.*pi.*t./TL),t,-TL./2,TL./2)./TL;
bni=2.*int(x_1.*sin(2.*ni.*pi.*t./TL),t,-TL./2,TL./2)./TL;
dF=dF+(ani.*2.*ni.*pi./TL).*sin(2.*ni.*pi.*t./TL)+(bni.*2.*ni.*pi./TL).*cos(2.*ni.*pi.*t./TL);
F=F+ani.*cos(2.*ni.*pi.*t./TL)+bni.*sin(2.*ni.*pi.*t./TL);
end
t=fzero(d,tspan);
给出的错误是这样的:
??? Error using ==> error
When the first input is a message identifier, the second input
must be a string.
Error in ==> fzero at 157
error('MATLAB:fzero:InvalidFUN',msg)
Error in ==> shoot2 at 36
t=fzero(df,tspan);


所有时间均为北京时间。现在的时间是 11:14

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.