フィルターのクリア

How to obtain a surface curve plane located on specific heights and with a different vector of color representation?

3 ビュー (過去 30 日間)
level is a (120,4) matrix. The columns correspond from 1 to 4 to X coordinate, Y coordinate, Z coordinate and a C scalar value.
When I use this code:
x = level(:,1);
y = level(:,2);
z = level(:,3);
xv = linspace(min(level(:,1)), max(level(:,1)), 20);
yv = linspace(min(level(:,2)), max(level(:,2)), 20);
[X,Y] = meshgrid(xv, yv);
Z = griddata(x,y,z,X,Y);
hold on
surf(X, Y, Z);
grid on
shading interp
axis equal
colorbar
I obtain this plot:
I would like to obtain a surface which is located exactly as I located this one, following the Z values of hight, but that the colors represent C values and not Z.
The colors of the surf plot should be folliwng this:
Any ideas about how to do it?

採用された回答

darova
darova 2020 年 3 月 12 日
Use cdata property
[x,y,z] = peaks(20);
c = sphere(19);
surf(x,y,z,'cdata',c)
  4 件のコメント
darova
darova 2020 年 3 月 12 日
do the same to your color vector

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by