title: code to close a matlab app
body: <p>I have written a Matlab app with the app designer tool, and have successfully coded everything except the pesky (and most likely simple) exit button. The button itself should do what it says, close the app when clicked, but looking online has just led me to dead ends. Here is what I have written down for the exit function; it doesn't work, but its better than writing no code:</p>
  
  <pre><code> % Button pushed function: ExitButton
      function ExitButtonPushed(app, event)
          Figurename = app.UIFigure ;
          close Figurename
      end
  </code></pre>