- v is a 100x3 array containing the 100 vertices
- f is an 81x4 array containing indices into v for the 81 faces
- c is an vector of the 100 data values which would be used for coloring the vertices
get mesh from surf function
조회 수: 2 (최근 30일)
이전 댓글 표시
Is there a way to get the mesh which the function "surf" produces? By that I mean I need the usual mesh format which is a list of vertices and a list of faces.
댓글 수: 0
채택된 답변
Mike Garrity
2015년 9월 4일
[x,y,z] = peaks(10);
h = surf(x,y,z);
[f,v,c] = surf2patch(h);
At this point:
추가 답변 (1개)
Adam
2015년 9월 3일
If you mean the X, Y and Z meshes that define the surface then the XData, YData and ZData properties of the surface object contain these and the CData contains the colour data for the ZData values.
댓글 수: 3
Adam
2015년 9월 3일
I'm not too familiar with mesh definitions, but FaceNormals and VertexNormals seem to be the only other sets of data you can extract from a surface object but they are m-by-n-by-3 arrays.
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!