How do I display an error message dialog box in a MATLAB app created with App Designer?

How do I display an error message dialog box in a MATLAB app created with App Designer?

 Réponse acceptée

You can use "uialert" with a try/catch block to catch and display the MATLAB error message in a pop-up dialog box.
Refer to the following documentation for more info on "uialert":
For example, the following code will show a pop-up dialog titled "Unable to connect to target" and displays the full MATLAB error message. By setting the interpreter to HTML, even hyperlinks are enabled:
try
% enter code
catch ME
uialert(app.UIFigure,ME.message,"Unable to connect to target","Interpreter","html");
end

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Produits

Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by