MATLAB: Using MCR, how can show a pop up window when the program fails to complete its execution

error messagemcr

While execution the program in matlab if an error ocuurs we can see the messaage about the error in command line. My question is if I run the program as a standalone executable file using mcr how can I display a message in screen warning the user if the program execution stopped because of an error?

Best Answer

Include the complete code in a try catch block and add a dialog before closing the function.