- 积分
- 1
- 注册时间
- 2009-12-14
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2012-2-22 13:00:26
|
显示全部楼层
来自 浙江杭州
数学模型:
x"+6x-5=0
%****************create a function**********
function dy=myfun(t,y)
n=3; % supposed
dy=[y(n+1:2*n);5-6*y(1:n)];
%************save*************
%************solve the function 'myfun'************
clc
clear
n=3;
tspan=[0 10];
y0=zeros(1,2*n);
[t,y]=ode45(@myfun,tspan,y0);
subplot(3,2,1),plot(t,y(:,1));
subplot(3,2,2),plot(t,y(:,2));
subplot(3,2,3),plot(t,y(:,3));
subplot(3,2,4),plot(t,y(:,4));
subplot(3,2,5),plot(t,y(:,5));
subplot(3,2,6),plot(t,y(:,6));
%************END**************
不知道这个是不是你要的
|
|