Error dialog instead of error message in command window

1 Ansicht (letzte 30 Tage)
Johan
Johan am 4 Jul. 2012
Hi! Is it possible to get a error dlg instead of error msg i command window? Tanks Johan

Akzeptierte Antwort

Image Analyst
Image Analyst am 4 Jul. 2012
Bearbeitet: Image Analyst am 4 Jul. 2012
Try this:
try
% Some code that generates an error/exception.
catch ME
errorMessage = sprintf('Error in function blah_blah_blah().\n\nError Message:\n%s', ME.message);
% Print to command window.
fprintf(1, '%s\n', errorMessage);
% Display pop up message and wait for user to click OK
uiwait(warndlg(errorMessage));
end

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Parallel Server finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by