From: malathi d on
can anyone pl help us to use errordialog box that should terminate the running program once the error occurs without closing the matlab .
From: Luca Balbi on
You should use both errordlg

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/errordlg.html

and then re-issue the error using error:

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/error.html