我有一个matlab .fig文件,其中包含一些点和一个曲面适合他们。我想要从图形中提取表面,我想要有顶点和脸。你能给我一些关于如何实现这一点的提示吗?
我的数字可以在这里找到:https://drive.google.com/file/d/0By376R0mxORYU3JsRWw1WjllWHc/view?usp=sharing和我想要提取没有蓝色点的表面。
编辑:这不是一个重复,见下面的评论,为什么。
发布于 2016-05-19 18:28:20
用于绘制表面和点的数据存储在图中。
因此,你可以:
这些轴实际上包含两组数据:
XData,YData,ZData中的点的数据XData、YData、ZData中的曲面数据这是代码(带有“点符号”):
% Open the figure
open('cubicinterp.fig')
% Get the data from the figure
x=gcf
% Get the children of the figure (in this case the axes)
y=x.Children
% Get the data used to plot on the axes
z=y.Children
figure
XX=z(2).XData;
YY=z(2).YData;
ZZ=z(2).ZData;
CCDD=z(2).CData;
surf(XX,YY,ZZ,CCDD)
return这是没有“点符号”的代码(在R2014b之前)。
% Open the figure
open('cubicinterp.fig')
% Get the data from the figure
x=gcf
% Get the children of the figure (in this case the axes)
y_1=get(gcf,'children');
% Get the data used to plot on the axes
z_1=get(y_1,'children');
figure
XX=get(z_1(2),'xdata');
YY=get(z_1(2),'ydata');
ZZ=get(z_1(2),'zdata');
CCDD=get(z_1(2),'Cdata');
surf(XX,YY,ZZ,CCDD)这是提取出来的表面:

希望这能有所帮助。
卡普拉
https://stackoverflow.com/questions/37330604
复制相似问题