声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 853|回复: 0

[编程技巧] 求助:请教一下如何解决这个错误(ode45解微分方程)

[复制链接]
发表于 2009-5-19 18:23 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
function jiezhuanhua01
x0=[1;0.5;1;1];
[t,X]=ode45(@zhuanhuan01,[0:0.15:3],x0)
function F=zhuanhuan01(t,x)
W=importdata('fangcheng.mat')   %调用的是下面存储的方程
F=inline(W)


function cunchu
syms a b c d
W=[sin(a)-2;tan(c)*sin(a)+1;sin(a)*cos(b)-2;tan(d)*sin(a)-1];
save fangcheng W

出错信息是:??? Error using ==> funfun\private\odearguments
Solving ZHUANHUAN01 requires an initial condition vector of length 1.

Error in ==> ode45 at 171
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, ...

Error in ==> jiezhuanhua01 at 3
[t,X]=ode45(@zhuanhuan01,[0:0.15:3],x0)
求求那位大侠帮帮忙解决一下。小弟感激不尽啦!
补注:上面的方程是一微分方程

[ 本帖最后由 liushuiwuxin 于 2009-5-19 18:24 编辑 ]
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 11:37 , Processed in 0.049924 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表