フィルターのクリア

surf(Z) Z= 11x9 double produces a 10x8 surface

2 ビュー (過去 30 日間)
Ali Afshar Dodson
Ali Afshar Dodson 2015 年 11 月 16 日
コメント済み: Stephen23 2015 年 11 月 16 日
I have a matrix of data 11x9 I wish to show as a surface. However
surf(Z)
surf(m,n,Z)
produce surfaces 10x8. Can anyone suggest how I can get all the results onto a surface? Thanks
  1 件のコメント
Stephen23
Stephen23 2015 年 11 月 16 日
This is the normal behavior of surf, as is explained in the answers below. If you want to plot each value as a distinct surface you could try using bar3.

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

採用された回答

Mike Garrity
Mike Garrity 2015 年 11 月 16 日
When you create a surface, each value in your matrix becomes one of the vertices of the surface. Since the faces of the surface each connect a 2x2 group of vertices, the number of faces is one fewer in each of the two directions.
I'm just guessing, but it might be that you want to use all 11x9 values as colors. To do this, try setting FaceColor to interp.
surf(m,n,Z,'FaceColor','interp')
When you do this, the position AND COLOR of each version will come from one of the values in your matrix, and they will be interpolated across the faces.

その他の回答 (1 件)

Thorsten
Thorsten 2015 年 11 月 16 日
編集済み: Thorsten 2015 年 11 月 16 日
The full matrix is shown by surf. The numbers define the outer points of each patch: consider
surf([1 2; 3 4])
that draws a single patch based on four points.

カテゴリ

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