Plot a "floating' 3D surface

6 ビュー (過去 30 日間)
Jose Manuel Gomez Guzman
Jose Manuel Gomez Guzman 2015 年 7 月 9 日
編集済み: Stephen23 2015 年 7 月 9 日
Hi guys,
this is my issue.
I have a 40x40 Z matrix (named MUHAT_E) that I want to plot in a grid. So till here is simple:
x=linspace(0,1,40); y=linspace(0,1,40); [X,Y]=meshgrid(x,y); surf(X,Y,MUHAT_E)
The problem is that I don't like the result of this command:
I would like to get two things in this plot (if possible):
  1. Remove the blue floor not plotting the zero values of the Z matrix.
  2. Give a "floating" aspect to the matrix not connecting the edges of the red area with the zeros values.
With those two modifications I would be able to see the concavity of the function from below. Is that possible?. I attach the MUHAT_E matrix.
Thanks!!!.

採用された回答

Stephen23
Stephen23 2015 年 7 月 9 日
編集済み: Stephen23 2015 年 7 月 9 日
Replace the zeros with NaNs, and they will not get plotted:
X = load('MUHAT_E.txt');
X(X==0) = NaN;
surf(X)
creates this figure:

その他の回答 (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