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
0 个评论
采纳的回答
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 Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!