基本形式
plot(x,y)
y=cos(x)在[0,4*pi]上的图像
x=[0:0.1:4*pi];
y=cos(x);
plot(x,y);
t=[0,1];x=[1,2];y=[x;3 4];z=[y;5 6];
plot(t,x); (0,1)(1,2)
plot(t,y); (0,1)(1,3) (0,2)(1,4)
plot(t,y'); (0,1)(1,2)(0,3)(1,4)
plot(t,z); (0,1)(1,2)(0,3)(1,4)(0,5)(1,6)
plot(t,z'); 相同
绘制向量y中元素的线形图
以下表为横坐标,元素值为纵坐标,等价于:
x=[1:length(y)];plot(x,y);
y=[0,0.48,0.84,1,0.91,6.14];
plot(y);
figure(2);
plot([1:length(y)],y)
plot(Y)
Y=[1 2;3 3;25],plot(Y);