| 查看: 1231 | 回复: 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 |
» 猜你喜欢
上海工程技术大学张培磊教授团队招收博士生
已经有3人回复
上海工程技术大学【激光智能制造】课题组招收硕士
已经有5人回复
求助院士们,这个如何合成呀
已经有4人回复
临港实验室与上科大联培博士招生1名
已经有9人回复
想换工作。大多数高校都是 评职称时 认可5年内在原单位取得的成果吗?
已经有7人回复
需要合成515-64-0,50g,能接单的留言
已经有4人回复
自荐读博
已经有4人回复
写了一篇“相变储能技术在冷库中应用”的论文,论文内容以实验为主,投什么期刊合适?
已经有6人回复
带资进组求博导收留
已经有10人回复
最近几年招的学生写论文不引自己组发的文章
已经有11人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求助 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







回复此楼