title: How to check if a figure is opened and how to close it?
body: <p>My m-file opens figures depending on parameters. Sometimes is one figure, sometimes it opens 2 figures.</p>
  
  <p>If the user call the function, the figures appear. If he calls the function again, with other parameters, I'm clearing figures with clf before the new plots.</p>
  
  <p>If the second call is set to draw only one figure, the second one (opened by the previous call) remain gray (because of the clf).</p>
  
  <p>Is there any way to check if it is opened and close it?</p>