| 查看: 1261 | 回复: 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 |
» 猜你喜欢
国自然申请面上模板最新2026版出了吗?
已经有15人回复
基金委咋了?2026年的指南还没有出来?
已经有4人回复
纳米粒子粒径的测量
已经有8人回复
疑惑?
已经有5人回复
计算机、0854电子信息(085401-058412)调剂
已经有5人回复
Materials Today Chemistry审稿周期
已经有5人回复
溴的反应液脱色
已经有7人回复
推荐一本书
已经有12人回复
基金申报
已经有4人回复
常年博士招收(双一流,工科)
已经有4人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求助 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











回复此楼