excel数据可视化模板:
clc;clear; close all
a=xlsread('tfx1.1.xlsx');
%% 图5.1
figure
subplot(3,2,1);
plot(a(:,1),a(:,2),'b-.','LineWidth',1.2);
hold on
plot(a(:,1),a(:,3),'y-.','LineWidth',1.2);
legend('钢绳1');
xlabel('帧数', 'fontsize',10);
ylabel('电压', 'fontsize',10);
subplot(3,2,2);
plot(a(:,1),a(:,4),'r-.','LineWidth',1.2);
hold on
plot(a(:,1),a(:,5),'b-.','LineWidth',1.2);
legend('钢绳2');
xlabel('帧数', 'fontsize',10);
ylabel('电压', 'fontsize',10);
subplot(3,2,3);
plot(a(:,1),a(:,6),'m-.','LineWidth',1.2);
hold on
plot(a(:,1),a(:,7),'r-.','LineWidth',1.2);
legend('钢绳3');
xlabel('帧数', 'fontsize',10);
ylabel('电压', 'fontsize',10);
subplot(3,2,4);
plot(a(:,1),a(:,8),'y-.','LineWidth',1.2);
hold on
plot(a(:,1),a(:,9),'m-.','LineWidth',1.2);
legend('钢绳4');
xlabel('帧数', 'fontsize',10);
ylabel('电压', 'fontsize',10);
subplot(3,2,5);
plot(a(:,1),a(:,10),'c-.','LineWidth',1.2);
hold on
plot(a(:,1),a(:,11),'y-.','LineWidth',1.2);
legend('钢绳5');
xlabel('帧数', 'fontsize',10);
ylabel('电压', 'fontsize',10);
subplot(3,2,6);
plot(a(:,1),a(:,12),'k-.','LineWidth',1.2);
hold on
plot(a(:,1),a(:,13),'c-.','LineWidth',1.2);
legend('钢绳6');
xlabel('帧数', 'fontsize',10);
ylabel('电压', 'fontsize',10);