| 查看: 1665 | 回复: 7 | ||
wzycrfpxz新虫 (初入文坛)
|
[求助]
matlab 问题求助,一段程序出错,求纠错
|
|
function dx=lunar(t,x,u) syms t x u; u0=45760.00; if ((x(6)/x(5))*cos(atan(x(7)/x(6)))+(x(7)/x(5))*sin(atan(x(7)/x(6)))-(3.283e-4)*x(10))+1>0 u=u0; else u=0.00; dx=[(u/x(5))*cos(atan(x(7)/x(6))); (u/x(5))*sin(atan(x(7)/x(6))); x(1); x(2); (-3.281e-4)*u; 0; -x(9); 0; 0; (u/x(5)^2)*cos(atan(x(7)/x(6)))*x(6)+(u/x(5)^2)*sin(atan(x(7)/x(6)))*x(7)]; end ??? Error using ==> mupadmex Error in MuPAD command: Index exceeds matrix dimensions. Error in ==> sym.sym>sym.subsref at 1366 B = mupadmex('mllib::subsref',A.s,inds{:}); Error in ==> lunar at 4 if ((x(6)/x(5))*cos(atan(x(7)/x(6)))+(x(7)/x(5))*sin(atan(x(7)/x(6)))-(3.283e-4)*x(10))+1>0 |
» 猜你喜欢
E0414, 我的本子有没有希望?
已经有7人回复
有谁可曾问过你过的还好吗?
已经有17人回复
一篇论文同时出现在两个期刊,一模一样,这算不算学术不端,请各位老师斧正。
已经有12人回复
希望面上有个好结果
已经有7人回复
今年也是没消息就是没中么
已经有16人回复
三区计算机方向期刊推荐
已经有5人回复
sci论文二审求助
已经有5人回复
函评
已经有7人回复
买卖文章的刷屏了!
已经有3人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求助 matlab交点问题
已经有19人回复
求助一简单matlab程序的出错问题,谢谢
已经有3人回复
【求助】向各位大侠求助matlab求解微分方程组遇到的一个问题
已经有21人回复
【求助】MATLAB多个mat中 数据画图问题
已经有7人回复
【求助】matlab 二次规划的优化的问题
已经有4人回复
【求助】使用Matlab预估动力学方程问题
已经有13人回复

2楼2012-08-23 10:02:49
wzycrfpxz
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 1255.8
- 红花: 1
- 帖子: 15
- 在线: 21.6小时
- 虫号: 1947568
- 注册: 2012-08-20
- 专业: 系统科学与系统工程
3楼2012-08-23 10:06:51

4楼2012-08-23 10:22:14

5楼2012-08-23 10:23:37
wzycrfpxz
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 1255.8
- 红花: 1
- 帖子: 15
- 在线: 21.6小时
- 虫号: 1947568
- 注册: 2012-08-20
- 专业: 系统科学与系统工程
|
function dx=lunar(t,x) if ((x(6)/x(5))*cos(atan(x(7)/x(6)))+(x(7)/x(5))*sin(atan(x(7)/x(6)))-(3.283e-4)*x(10))+1>0 u=45760.00; else u=0.00 dx=[(u/x(5))*cos(atan(x(7)/x(6))); (u/x(5))*sin(atan(x(7)/x(6))); x(1); x(2); (-3.281e-4)*u; 0; -x(9); 0; 0; (u/x(5)^2)*cos(atan(x(7)/x(6)))*x(6)+(u/x(5)^2)*sin(atan(x(7)/x(6)))*x(7)]; end 命令窗口:x0=[150;-44;0;2300;9472.06;0.005;-0.003501;0;5.415e-4;1]; tic,[t,y]=ode45(@lunar,[0,100],x0);toc Error in ==> lunar at 3 if ((x(6)/x(5))*cos(atan(x(7)/x(6)))+(x(7)/x(5))*sin(atan(x(7)/x(6)))-(3.283e-4)*x(10))+1>0 ??? Error using ==> feval Output argument "dx" (and maybe others) not assigned during call to "C:\Users\Administrator\Documents\MATLAB\lunar.m>lunar". Error in ==> odearguments at 110 f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0. Error in ==> ode45 at 173 [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, .. |
6楼2012-08-23 10:24:03

7楼2012-08-23 11:51:47
wzycrfpxz
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 1255.8
- 红花: 1
- 帖子: 15
- 在线: 21.6小时
- 虫号: 1947568
- 注册: 2012-08-20
- 专业: 系统科学与系统工程
8楼2012-08-23 14:32:59











回复此楼