How can I save to a variable and/or file, an error message from a guide?

2 ビュー (過去 30 日間)
Denise Selegato
Denise Selegato 2015 年 9 月 6 日
コメント済み: Denise Selegato 2015 年 9 月 7 日
When I get an error message from a guide, how can I save them to a variable or a file? Thank you Denise

採用された回答

Walter Roberson
Walter Roberson 2015 年 9 月 6 日
In the code that you think might generate an error, instead of calling
Some Statement Here
encode it in a try/catch block that does whatever you want with the error
try
Some Statement Here
catch ME
%deal with the error the way you need
fprintf('Caught error "%s" with details "%s"\n', ME.identifier, ME.message);
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by