找回密码
 注册
Simdroid-非首页
查看: 37|回复: 0

菜鸟求助! ??? Error using ==> funfun\private\odearguments

[复制链接]
发表于 2014-8-30 10:00:34 | 显示全部楼层 |阅读模式 来自 北京

程序代码如下:

function xht

global q m b e
q=1.6e-2;
m=0.02;
b=[2;1;0];
e=[1;0;1];
figure
strd{1}='e\neq 0,b\neq 0';
strd{2}='e=0,b\neq 0';
strd{3}='e\neq 0, b=0';
for i=1:3
[t,w]=ode23(@ddlzfun,[0:0.01:20],[0,0.01,0,6,0,0.01],[ ],q,m,b(i),e(i));
axes ('unit','normalized','position', [0.045+(i-1)*0.35 0.062 0.2786 0.6583 ]);
plot3(w(:,1),w(:,3),w(:,5),'linewidth',2);
grid on
title(strd{i},'fontsize',12,'fontweight','demi');
xlabel('x');
ylabel('y');
zlabel('z');
view([-51,18]);
end

function wdot=ddlzfun(t,w,q,m,b,e)
%该函数实现(3)式的差分迭代
syms q m b e
q=1.6e-2;
m=0.02;
b=[2;1;0];
e=[1;0;1];
wdot=[w(2); q.*b.*w(4)./m;w(4); q.*e./m- q.*b.*w(2)./m; w(6); 0];


执行报错:

??? Error using ==> funfun\private\odearguments
Solving DDLZFUN requires an initial condition vector of length 10.

Error in ==> ode23 at 172
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, ...

Error in ==> xht at 13
[t,w]=ode23(@ddlzfun,[0:0.01:20],[0,0.01,0,6,0,0.01],[ ],q,m,b(i),e(i));



您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-7-3 07:13 , Processed in 0.025703 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表