Matlab中的直线图

Matlab中的直线图,matlab,Matlab,如何在不使用surf的情况下对矩阵(如a=rand(5))进行线图绘制?如果要在二维图中单独绘制每一列,只需编写 plot(A) 如果要使用直线进行三维打印,可以编写: [xx,yy] = ndgrid(1:6,1:5); A = [A;NaN(1,size(A,2))]; %# add NaNs so that the lines will be plotted separately plot3(xx(:),yy(:),A(:)) %# use plot3(xx(:),yy(:),A(:),

如何在不使用surf的情况下对矩阵(如a=rand(5))进行线图绘制?

如果要在二维图中单独绘制每一列,只需编写

plot(A)
如果要使用直线进行三维打印,可以编写:

[xx,yy] = ndgrid(1:6,1:5);
A = [A;NaN(1,size(A,2))]; %# add NaNs so that the lines will be plotted separately
plot3(xx(:),yy(:),A(:)) %# use plot3(xx(:),yy(:),A(:),'.') if you want to plot dots instead of lines.