How to extract data from a 3d implicit plot?

1 回表示 (過去 30 日間)
Amir
Amir 2012 年 6 月 30 日
Hi,
I would like to extract data from 3d implicit plot. My plot:
[Y,X,Z] = ndgrid(linspace(-2,2,30),linspace(-2,2,30),linspace(-2,2,30));
V = ((X.^2).*(1-X.^2)-Y.^2).^2+0.5*Z.^2-0.025*(1+1.0*(X.^2+Y.^2+Z.^2));
p = patch(isosurface(X,Y,Z,V,0));
isonormals(X,Y,Z,V,p);
set(p,'FaceColor','b','EdgeColor','k','FaceAlpha',0.1,'EdgeColor','none');
daspect([1 1 1])
axis square;
How can I get the coordinates of the points on the surface?
Thanks.
  2 件のコメント
per isakson
per isakson 2012 年 7 月 1 日
"'EdgeColor','none' " on a separate line looks as a mistake
Amir
Amir 2012 年 7 月 1 日
It was a mistake, thak you!

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

採用された回答

per isakson
per isakson 2012 年 7 月 1 日
編集済み: per isakson 2012 年 7 月 1 日
Matlab has a tool called "Data Cursor". It has a icon in the Tool bar of the Figure window. With that you can "extract" data from the diagram. Select a point, right click, choose Export Cursor Data ...
Is that what you mean?
--- Cont. ---
The surface is represented by a patch with the handle, p.
"points on the surface" is a bit vague.
get(p) returns a list of properties of the patch. Those of interest to you are
...
Vertices = [ (584 by 3) double array]
XData = [ (3 by 1172) double array]
YData = [ (3 by 1172) double array]
ZData = [ (3 by 1172) double array]
...
The vertices are "points on the surface".
  1 件のコメント
Amir
Amir 2012 年 7 月 1 日
Thanks, but I would like to export all the points of the surface on the grid. If I work with a 100x100x100 grid it's impossible to get the points with 'Data Cursor'.

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

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