how to plot a matrix with vector ??

조회 수: 7 (최근 30일)
yasmeen hadadd
yasmeen hadadd 2018년 3월 6일
답변: Star Strider 2018년 3월 6일
A=[ 1 2 3 ; 4 5 6; 7 8 9]; B=1:3; imagesc(A,B)

채택된 답변

Star Strider
Star Strider 2018년 3월 6일
Depending on what you want, one of these will work:
A=[ 1 2 3 ; 4 5 6; 7 8 9];
B=1:3;
figure(1)
plot(B, A)
grid
figure(2)
surf(A)
set(gca, 'XTick',B)
grid on
If you want a 2D version of the surf plot, add:
view(0, 90)
after it.
Experiment to get the result you want.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by