F = figure('Units','normalized'); h2 = uipanel(F,'Position',[0.55 0 0.45 1]); h1 = uipanel(F,'Position',[0 0 0.45 1], 'DeleteFcn','delete(allchild(gcbf))'); close(F)