MATLAB中的画图程序和将xls表格数据化为图像
clc;
clear all;
close all;
dataGZ=...
[ 1 5.52693708 5.523209824
2 11.04270613 5.506480584
。。。
100 72.38233199 0.032127012];
dataLhasa=...
[1 5.054826411 5.052868731
2 10.10378374 5.044071989
。。。
100 82.06008295 0.082937259...
];
timeGZ=dataGZ(:,1);
velocityGZ=dataGZ(:,2);
accelerationGZ=dataGZ(:,3);
timeLhasa=dataLhasa(:,1);
velocityLhasa=dataLhasa(:,2);
accelerationLhasa=dataLhasa(:,3);
figure(1)
plot(timeGZ,velocityGZ,'.')
xlabel('time/s')
ylabel('velocity/m/s')
hold on
plot(timeLhasa,velocityLhasa,'o')
legend('velocity of GZ','velocity of Lhasa','Location','SouthEast');
figure(2)
plot(timeGZ,accelerationGZ,'.')
xlabel('time/s')
ylabel('acceleration/m/s^2')
hold on
plot(timeLhasa,accelerationLhasa,'o')
legend('acceleration of GZ','acceleration of Lhasa','Location','NorthEast');
stop_point=20;
figure(3)
plot(timeGZ(1:stop_point),accelerationGZ(1:stop_point),'.')
xlabel('time/s')
ylabel('acceleration/m/s^2')
hold on
plot(timeLhasa(1:stop_point),accelerationLhasa(1:stop_point),'o')
legend('acceleration of GZ','acceleration of Lhasa','Location','NorthEast');