Error dialog instead of error message in command window
3 次查看(过去 30 天)
显示 更早的评论
Hi! Is it possible to get a error dlg instead of error msg i command window? Tanks Johan
0 个评论
采纳的回答
Image Analyst
2012-7-4
编辑:Image Analyst
2012-7-4
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!