Plot 3D (colormap)

65 ビュー (過去 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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by