MATLAB: How to display error

displayerrorexe fileguideMATLAB Compiler

I created a Gui and when I am running from the .exe file it crashes and just make a sound which is showing that the program stopped. When I am running it through matlab it works perfect and there is no error. How can I add something to the program to show what is the error and why the program crashes? I need to display the error while i am using the .exe file.
Related Question