photo

Nana


North Carolina A&T State University

自 2011 起处于活动状态

Followers: 0   Following: 0

消息

I copied this

function dy = rigid(t,y)
dy = zeros(3,1); % a column vector
dy(1) = y(2) * y(3);
dy(2) = -y(1) * y(3);
dy(3) = -0.51 * y(1) * y(2);
options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[T,Y] = ode45(@rigid,[0 12],[0 1 1],options);
plot(T,Y(:,1),'-',T,Y(:,2),'-.',T,Y(:,3),'.')

and tried to run but it gave error message "??? Input argument "y" is undefined.

Error in ==> rigid at 3
dy(1) = y(2) * y(3);

What should be the problem?

统计学

MATLAB Answers

1 个提问
0 个回答

排名
255,765
of 297,503

声誉
0

贡献数
1 个提问
0 个回答

回答接受率
0.0%

收到投票数
0

排名
 of 20,449

声誉
N/A

平均
0.00

贡献数
0 文件

下载次数
0

ALL TIME 下载次数
0

排名

of 159,017

贡献数
0 个问题
0 个答案

评分
0

徽章数量
0

贡献数
0 帖子

贡献数
0 公开的 个频道

平均

贡献数
0 个亮点

平均赞数

Feeds

排序方式:

提问


Example in your ode45 tutorial is not running
I have the same problem trying to solve 3 nonlinear differential equations for my modeling. I tried to run your own tutorial ex...

13 years 前 | 2 个回答 | 0

2

个回答