Modal figures do not display menu children, built-in menus, or toolbars. Therefore, you can hide a modal window for later reuse, instead of destroying it. UI figures with the WindowStyle property set to 'modal' and the Visible property set to 'off' do not behave modally until MATLAB makes them visible.
This allows the user to type at the command line. Typing Ctrl+C when a modal figure has focus causes that figure to revert to a 'normal' WindowStyle property setting. Interactions with application windows other than MATLAB are also not blocked. Unlike modal figures created with the figure function, modal figures created with the uifigure function do not block access to figures created with the figure function or the MATLAB desktop. Fig3.WindowStyle = 'modal' The modality hierarchy is not preserved if there is a combination of modal and normal figures in the hierarchy of figures.