【问题标题】:trisurf doesn't work in my MATLAB GUI codetrisurf 在我的 MATLAB GUI 代码中不起作用
【发布时间】:2013-07-11 18:26:03
【问题描述】:

我正在尝试编写一个代码来绘制我用 convhulln 生成的一些点的凸包。我有三角形数据(n x 3 矩阵)和点的笛卡尔坐标(m x 3)。通常,当我不处理 GUI 时,我可以执行以下操作,并且没有问题:

a=rand(20,3);
t=convhulln(a);
trisurf(t,a(:,1),a(:,2),a(:,3));

这很好用。但是当我尝试在 GUI 的代码中做同样的事情时,它不起作用。这是我所拥有的:

tt=convhulln(cluster);
trisurf(handles.trisurf_area,tt,cluster(:,1),cluster(:,2),cluster(:,3));

trisurf_area是绘图区的标签。

我还应该注意,以下代码可以正常工作:

scatter3(handles.trisurf_area,cluster(:,1),cluster(:,2),cluster(:,3));

我使用 MATLAB 2012a。

【问题讨论】:

    标签: matlab user-interface plot


    【解决方案1】:

    试试trisurf(tt,a(:,1),a(:,2),a(:,3),'Parent',handles.trisurf_area)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 2018-10-25
      相关资源
      最近更新 更多