I was wondering if there is a way to prevent an error dialog (errordlg) to appear when an existing error dialog hasn't been attended yet. I'm developing a GUI in matlab and I can easily make 50 error dialogs to appear and collapse my task manager as it is shown in the picture.

On the other hand, I have seen warning or error dialogs that don't let the user to operate the GUI until he attends them. Is there anyway to do that?
Thanks in advance! Charlie