closing a specified figure (if exist)

25 次查看(过去 30 天)
does anyone know how to close a specified figure if it exists currently? for example: h=figure
if h exists close(h) end

采纳的回答

Grzegorz Knor
Grzegorz Knor 2011-9-6
h = figure;
if ishandle(h)
close(h)
end
  4 个评论
Grzegorz Knor
Grzegorz Knor 2011-9-6
close(findobj('type','figure','name','flashing'))

请先登录,再进行评论。

更多回答(2 个)

Paulo Silva
Paulo Silva 2011-9-6
close(findall(0,'type','figure','name','flashing'))

Zoltan Gal
Zoltan Gal 2019-4-13
If the index of figure is 5, then
close(findobj('type','figure','number',5))

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by