I would like my MATLAB script to wait until the user closes all open figures, in any order, before continuing.  Can you write lines of MATLAB code that will do this?