Surf plot with a mask

11 ビュー (過去 30 日間)
Mara Meggiorin
Mara Meggiorin 2019 年 9 月 20 日
回答済み: darova 2019 年 9 月 20 日
Hi,
I'd like to plot an elevation map with surf, and it work quite well.
Howevr I'd like to color the surface not basing on Z bat basing on another matrix I have that is a logical mask.
I do not want to make transparent or not, I want two different colors basing on the mask.
How can I do?
Thanks

採用された回答

darova
darova 2019 年 9 月 20 日
Use CData property:
[X,Y] = meshgrid(-5:5);
Z = -X.^2-Y.^2;
C = rand(size(Z));
surf(X,Y,Z,'Cdata',C)

その他の回答 (0 件)

カテゴリ

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