24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 955  |  回复: 0

wyjjf

新虫 (正式写手)

[交流] MATLAB出现有错吗?

MATLAB有错吗?
(1)dx=[dx(1);dx(2);dx(3);dx(4);dx(5);dx(6)];       %这一句和书上一样啊?
(2)[t,x]=ode45('ODE45_fun',tspan,x0);    %和书上也是一样啊
(3)另外不懂:
The element type "name" must be terminated by the matching end-tag "</name>".
Could not parse the file: d:\matlab7\toolbox\ccslink\ccslink\info.xml
(4)实在不懂【求解释,谢谢】:
Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:});   % ODE15I sets args{1} to yp0.
点击 funfun\private\odearguments at 110 后出现110-118:
f0 = feval(ode,t0,y0,args{:});   % ODE15I sets args{1} to yp0.
[m,n] = size(f0);
if n > 1
  error('MATLABdearguments:FoMustReturnCol',...
        [funstring(ode) ' must return a column vector.'])
elseif m ~= neq
  msg = sprintf('an initial condition vector of length %d.',m);
  error('MATLABdearguments:SizeIC', ['Solving ' funstring(ode) ' requires ' msg]);
end
(5)实在不懂【求解释,谢谢】:
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, ...
点击 funfun\private\odearguments at 110 后出现173-178:
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, ...
options, threshold, rtol, normcontrol, normy, hmax, htry, htspan, ...
dataType] = ...
    odearguments(FcnHandlesUsed, solver_name, odeFcn, tspan, y0, ...
                 options, varargin);
nfevals = nfevals + 1;


以下是该程序
ODE45_fun:

function dx=ODE45_fun(t,x)
a1=1;a2=1;e1=9;e2=7;f1=56;f2=98;g1=76;g2=665;
a=a1+a2;
e=e1+e2;
f=f1+f2;
g=g1+g2;
dx(1)=x(3)-x(2)+x(4)*x(2)-2*x(5)*x(2)-x(2)*x(2)-x(5)-e-f-g;
dx(2)=x(1)-x(3)+x(4)*x(2)-x(2)*x(2)-x(5)*x(5)-x(5)*x(2)-e*f-g;
dx(3)=x(2)-x(1)+x(5)*x(1)-x(4)*x(3)+x(3)+x(4)+e*g+f;
x(6)=x(4)*x(5)+x(2)*x(3)+e*f+e*g;
dx(4)=x(5)*a+x(3)*x(1)+x(3)+e*f*g*x(6)
dx(5)=x(4)*a+x(2)*x(1)-e*f*x(1)-x(2)*x(2)*x(5)-x(2)*x(5)*x(5)-e*f-f*g

dx=[dx(1);dx(2);dx(3);dx(4);dx(5);dx(6)];

ODE45_main:
tspan=[0,10];
x0=[0;0.1;2;0;0.1;2];
[t,x]=ode45('ODE45_fun',tspan,x0);
data=[t,x];
save ODE45_data.txt data -ascii
subplot(2,3,1),plot(t,x(1))
subplot(2,3,2),plot(t,x(2))
subplot(2,3,3),plot(t,x(3))
subplot(2,3,4),plot(t,x(4))
subplot(2,3,5),plot(t,x(5))
subplot(2,3,6),plot(t,x(6))

MATLAB出现有错吗?
出错信息.jpg


MATLAB出现有错吗?-1
六元方程组怎么用MATLAB编辑程序?.jpg
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

找到一些相关的精华帖子,希望有用哦~

科研从小木虫开始,人人为我,我为人人
相关版块跳转 我要订阅楼主 wyjjf 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 本科985,专业0812分336求调剂 +4 莫莫很行 2026-04-03 4/200 2026-04-03 21:31 by zhq0425
[考研] 一志愿重庆大学085404,总分314分,求调剂 +4 zf83hn 2026-04-03 4/200 2026-04-03 21:25 by 啵啵啵0119
[考研] 283分求调剂 +6 小聂爱学习 2026-04-03 6/300 2026-04-03 20:46 by zhq0425
[考研] 材料专硕322分 +13 哈哈哈吼吼吼哈 2026-04-01 13/650 2026-04-03 16:08 by 哦哦123
[考研] 321求调剂 +17 y-yh 2026-04-01 20/1000 2026-04-03 12:57 by y-yh
[考研] 总分328生物与医药考数学求调剂 +6 aaadim 2026-04-02 7/350 2026-04-03 12:56 by 王亮_大连医科大
[考研] 求调剂 +3 晟功? 2026-04-03 3/150 2026-04-03 11:52 by wxiongid
[考研] 289求调剂 +4 Acesczlo 2026-03-29 5/250 2026-04-03 10:09 by 不168
[考研] 362求调剂 +14 西南交材料专硕3 2026-03-31 14/700 2026-04-02 17:50 by yunlongyang
[考研] 能源动力 调剂 +3 不破不立0 2026-04-02 3/150 2026-04-02 12:46 by ffffjjjj
[考研] 372求调剂 +3 jj涌77 2026-04-02 3/150 2026-04-02 09:57 by olim
[考研] 一志愿北京科技,085601总分305求调剂 +9 半生瓜! 2026-04-01 11/550 2026-04-02 08:28 by Wang200018
[考研] 材料调剂 +11 一样YWY 2026-03-31 11/550 2026-04-01 22:25 by zhouyuwinner
[考研] 307分求调剂 +14 (o~o) 2026-03-31 15/750 2026-04-01 20:43 by longlotian
[考研] 085600,320分求调剂 +5 大馋小子 2026-04-01 6/300 2026-04-01 19:40 by 唐沐儿
[考研] 288资源与环境专硕求调剂,不限专业,有学上就行 +25 lllllos 2026-03-30 26/1300 2026-04-01 09:52 by 一只好果子?
[考研] 0856 335分 +9 cccchenso 2026-03-29 9/450 2026-03-31 16:37 by lishahe
[考研] 323分 食品与营养调剂 +3 嘿ooo 2026-03-31 3/150 2026-03-31 09:38 by longlotian
[考研] 297 地理学070500 复试求调剂 +3 小圆圈圈ooo 2026-03-30 3/150 2026-03-30 21:05 by 余震yz
[考研] 285求调剂 +6 AZMK 2026-03-29 9/450 2026-03-30 21:02 by dophin1985
信息提示
请填处理意见