📄 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 + -