Need popup for end user instead of ding for code failure

1 visualización (últimos 30 días)
I am using the Application Compiler App in Matlab for a end user to use a GUI from GUIDE. Sometimes the code failes for whatever reason and a loud ding is issued. Instead of a ding how would I have a Popup like ...h = msg('The code has failed please rerun') or similar to pop up to allow the user to know there code failed encase they had the volume on mute and did not hear the ding. Thank you

Respuesta aceptada

Walter Roberson
Walter Roberson el 28 de Dic. de 2016
Use a try/catch block around any questionable code.
If the error might be in something you cannot effectively control, such as if a Callback property had been set to something invalid and an error is generated when the callback is triggered, then there is not really anything you can do. You can use "dbstop if error" to cause the debugger to be triggered, but you would not be able to run your own code in such a case.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by