| 8 | 1/1 | 返回列表 |
| 查看: 1399 | 回復: 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 |
榮譽版主 (著名寫手)
彩色掛圖
![]() |
專家經(jīng)驗: +2 |

新蟲 (初入文壇)
榮譽版主 (著名寫手)
彩色掛圖
![]() |
專家經(jīng)驗: +2 |

榮譽版主 (著名寫手)
彩色掛圖
![]() |
專家經(jīng)驗: +2 |

新蟲 (初入文壇)
|
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, .. |
榮譽版主 (著名寫手)
彩色掛圖
![]() |
專家經(jīng)驗: +2 |

新蟲 (初入文壇)
| 8 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 293求調(diào)劑 +11 | zjl的號 2026-03-16 | 16/800 |
|
|---|---|---|---|---|
|
[考研] 0703化學336分求調(diào)劑 +5 | zbzihdhd 2026-03-15 | 6/300 |
|
|
[考研] 考研求調(diào)劑 +3 | 橘頌. 2026-03-17 | 4/200 |
|
|
[考研] 一志愿蘇州大學材料工程(085601)專碩有科研經(jīng)歷三項國獎兩個實用型專利一項省級立項 +6 | 大火山小火山 2026-03-16 | 8/400 |
|
|
[考研] 0854可跨調(diào)劑,一作一項核心論文五項專利,省、國級證書40+數(shù)一英一287 +3 | 小李0854 2026-03-16 | 3/150 |
|
|
[考研] 0854控制工程 359求調(diào)劑 可跨專業(yè) +3 | 626776879 2026-03-14 | 9/450 |
|
|
[考研] 326求調(diào)劑 +4 | 諾貝爾化學獎覬?/a> 2026-03-15 | 7/350 |
|
|
[考研] 304求調(diào)劑 +3 | 曼殊2266 2026-03-14 | 3/150 |
|
|
[考研] 070303一志愿西北大學學碩310找調(diào)劑 +5 | d如愿上岸 2026-03-12 | 8/400 |
|
|
[考研] 327求調(diào)劑 +6 | 拾光任染 2026-03-15 | 11/550 |
|
|
[考研] 求老師收留調(diào)劑 +4 | jiang姜66 2026-03-14 | 5/250 |
|
|
[考研] 26考研一志愿中國石油大學(華東)305分求調(diào)劑 +3 | 嘉年新程 2026-03-15 | 3/150 |
|
|
[考研] 297一志愿上交085600求調(diào)劑 +5 | 指尖八千里 2026-03-14 | 5/250 |
|
|
[考研] 復試調(diào)劑 +3 | 呼呼?~+123456 2026-03-14 | 3/150 |
|
|
[考研] 一志愿中科院,化學方向,295求調(diào)劑 +4 | 一氧二氮 2026-03-11 | 4/200 |
|
|
[考研] 0703,333分求調(diào)劑 一志愿鄭州大學-物理化學 +3 | 李魔女斗篷 2026-03-11 | 3/150 |
|
|
[考研] 0856材料與化工301求調(diào)劑 +5 | 奕束光 2026-03-13 | 5/250 |
|
|
[考研] 329求調(diào)劑 +3 | miaodesi 2026-03-12 | 4/200 |
|
|
[考研] 281求調(diào)劑 +9 | Koxui 2026-03-12 | 11/550 |
|
|
[考研] 材料301分求調(diào)劑 +5 | Liyouyumairs 2026-03-12 | 5/250 |
|