?? yunxing.m
字號:
%************************************************************%
%************6個狀態變量勻速運動下的常微分方程曲線圖*********%
%************************************************************%
clc
clear all
[t,y]=ode45('observability',[0:2:35*3600],[3*pi/(60*180);3*pi/(60*180);5*pi/(60*180);0.1;0.1;2*pi/(60*180)]);
yy=zeros(501,6);
%每隔126點保存一次,放在矩陣yy
yy(1,:)=y(1,:);
for j=1:500
for i=2:127
yy(j+1,:)=y(126*j+1,:);
end
end
x1=yy(:,1)*180*60/pi;
x2=yy(:,2)*180*60/pi;
x3=yy(:,3)*180*60/pi;
x4=yy(:,4);
x5=yy(:,5);
x6=yy(:,6)*180*60/pi;
%畫圖
t=0:252/3600:35;
figure(1)
subplot(3,1,1)
plot(t,x1,'b');
xlabel('time/h');
grid on;
subplot(3,1,2)
plot(t,x2,'b');
xlabel('time/h');
grid on;
subplot(3,1,3)
plot(t,x3,'b');
xlabel('time/h');
grid on;
figure(2)
subplot(3,1,1)
plot(t,x4,'b');
xlabel('time/h');
grid on;
subplot(3,1,2)
plot(t,x5,'b');
xlabel('time/h');
grid on;
subplot(3,1,3)
plot(t,x6,'b');
xlabel('time/h');
grid on;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -