Displaying Errors without try-catch in a GUI

1 回表示 (過去 30 日間)
Bogdan Dzyubak
Bogdan Dzyubak 2013 年 1 月 23 日
When code is run in MATLAB, there is large number of errors that can be displayed. I can only code a finite number with try-catch statements and might loose some information that way. Is there a way to output any sort of errors/warnings that would be displayed in the command window into a GUI?
Thanks in advance, Bogdan

回答 (2 件)

Image Analyst
Image Analyst 2013 年 1 月 23 日
If you don't use try/catch, then when it hits the first error it totally crashes and your program ends, which is not a very elegant or professional way of interacting with your users.
If you want, you only need a try catch at the upper level (say a button callback) and any deeper level errors from dependent functions will bubble up to your top-most catch.

Walter Roberson
Walter Roberson 2013 年 1 月 23 日
evalc()

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by