how to plot a 3d surface using a matrix

조회 수: 1 (최근 30일)
Antonios Georgantas
Antonios Georgantas 2018년 10월 23일
댓글: Star Strider 2018년 10월 24일
I have a matrix d = 6x181, each of the numbers comprising it being density. How can I draw a surface plot against p and m, where m=1:1:6 and s=0:20:181? There was a similar question in the forum addressing the case of a matrix M with equal dimensions, but it was unclear to me, how to model it for my situation. Any help would be greatly appreciated.

채택된 답변

Star Strider
Star Strider 2018년 10월 23일
Another option:
d = sin((1:6)' * (1:181) / 90); % Creates (6x181) Matrix
m = 1:6;
p = 0:20:181;
figure
surf(d)
set(gca, 'XTick',p, 'YTick',m)
xlabel('p')
ylabel('m')
  댓글 수: 2
Antonios Georgantas
Antonios Georgantas 2018년 10월 24일
Thank you @Star Strider. This worked perfectly.
Star Strider
Star Strider 2018년 10월 24일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 10월 23일
See warp() which can accept arbitrary rectangular grid of coordinates including non uniform.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by