首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >利用matlab .fig提取曲面

利用matlab .fig提取曲面
EN

Stack Overflow用户
提问于 2016-05-19 17:49:22
回答 1查看 510关注 0票数 1

我有一个matlab .fig文件,其中包含一些点和一个曲面适合他们。我想要从图形中提取表面,我想要有顶点和脸。你能给我一些关于如何实现这一点的提示吗?

我的数字可以在这里找到:https://drive.google.com/file/d/0By376R0mxORYU3JsRWw1WjllWHc/view?usp=sharing和我想要提取没有蓝色点的表面。

编辑:这不是一个重复,见下面的评论,为什么。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-19 18:28:20

用于绘制表面和点的数据存储在图中。

因此,你可以:

  • 打开图形
  • 从图中获取数据
  • 把人像的孩子们,在这种情况下,用斧头
  • 从曲面的轴、X、y和z数据中提取数据。

这些轴实际上包含两组数据:

  • 存储在z(1) XDataYDataZData中的点的数据
  • 存储在z(2) XDataYDataZData中的曲面数据

这是代码(带有“点符号”):

代码语言:javascript
复制
% 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之前)。

代码语言:javascript
复制
% 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)

这是提取出来的表面:

希望这能有所帮助。

卡普拉

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37330604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档