Plot 3D (colormap)

조회 수: 60 (최근 30일)
Yrobel Lima
Yrobel Lima 2017년 10월 24일
댓글: KSSV 2017년 10월 25일
How can I plot a Matlab function in 3d (X, Y, Z) ?. I used the tri = delaunay (x, y) and h = trisurf (tri, x, y, z) function but I do not use it because it distorts the values. I need to get a color map of the distribution. Thank you very much, I hope you can help me.
  댓글 수: 4
KSSV
KSSV 2017년 10월 25일
Attach your data.....it should be plotted as you expected.
Yrobel Lima
Yrobel Lima 2017년 10월 25일
편집: Walter Roberson 2017년 10월 25일
Thanks, I attached the file with the values.

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

답변 (2개)

KSSV
KSSV 2017년 10월 25일
[num,txt,raw] = xlsread('DATA.xlsx') ;
X = num(:,1) ;
Y = num(:,2) ;
Z = num(:,3) ;
N = 100 ;
x = linspace(min(X),max(X),N) ;
y = linspace(min(Y),max(Y),N) ;
[Xi,Yi] = meshgrid(x,y) ;
Zi = griddata(X,Y,Z,Xi,Yi) ;
surf(Xi,Yi,Zi)
  댓글 수: 2
Yrobel Lima
Yrobel Lima 2017년 10월 25일
Thank you very much, your response was very helpful.
KSSV
KSSV 2017년 10월 25일
Thanking is accepting the answer. :)

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


Walter Roberson
Walter Roberson 2017년 10월 25일
F = scatteredInterpolant(x,y,z);
[X,Y] = ndgrid(linspace(-295,295,500),linspace(-510,510,500));
Z = F(X,Y);
surf(X, Y, Z, 'edgecolor', 'none')
  댓글 수: 1
Yrobel Lima
Yrobel Lima 2017년 10월 25일
Thank you very much, your response was very helpful.

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

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by