Plotting a 2D matrix
이전 댓글 표시
I need to plot a matrix M which is 300*42 in size. On the X axis I need to plot 1:42. On the Y Axis I need to plot the value corresponding to the 42 values. On the Z axis I need to plot the 1:300 value.
I tried using the plot3 function in a loop like this and I wouldnt get it right :
for i = 1:300
plot( 1:42, M(i, 1:42), 1:i);
hold on;
drawnow ;
end
I get the error Vectors are not of similar lengths. Please Help. Many thanks
Regards
댓글 수: 3
pietro
2014년 6월 27일
how can you make a plot of vectors with different sizes?
Alok Pathak
2014년 6월 27일
Gnaneswar Nadh satapathi
2014년 6월 27일
plot it as
surf(M)
채택된 답변
추가 답변 (1개)
David Sanchez
2014년 6월 27일
Maybe you are thinking no something like this:
M=rand(300,42); % your data here
[xx, yy] = meshgrid(1:42,1:300);
plot3(xx,yy,M,'*')
카테고리
도움말 센터 및 File Exchange에서 Exploration and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!