MATLAB: Close a figure when a button is pressed or when a certain elapses

closingfigurekey pressMATLABplottingtime

Hello I'd like to know if there is a way to erase a figure when either a button is pressed or a specific period of time elapses.

Best Answer

You can set 'close(gcbf)' as the callback of your button, and you could use a timer object to trigger a close as well.
Related Question