%绘制多条折线图
clear
clc
n = 12;
x = 1:n;
C = 10 * rand(n,1);
A = 10 * rand(n,1);
J = 10 * rand(n,1);
figure;
plot(x,C,'s-',x,A,'s-.',x,J,'s--');
legend('C','A','J');
Effect:
%绘制多条折线图
clear
clc
n = 12;
x = 1:n;
C = 10 * rand(n,1);
A = 10 * rand(n,1);
J = 10 * rand(n,1);
figure;
plot(x,C,'s-',x,A,'s-.',x,J,'s--');
legend('C','A','J');
Effect: