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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by