函数退出后保持matlab视图打开

时间:2019-02-16 00:01:19

标签: matlab matlab-figure point-clouds

我有一个绘制点云的函数。当我调用该函数时,它会显示点云,但是一旦该函数退出,视图也会退出。如何防止视图退出?

function drawPtCloud(ptCloud,colorLabels)
  player = pcplayer(xlimits, ylimits, zlimits);
  view(player, ptCloud,colorLabels);
end

1 个答案:

答案 0 :(得分:1)

轴实际上保存在pcplayer的输出参数中。将pcplayer的输出参数,即player用作自定义函数drawPtCloud的输出参数。即

function player = drawPtCloud(ptCloud, colorLabels)
  player = pcplayer(xlimits, ylimits, zlimits);
  view(player, ptCloud,colorLabels);
end