try/catch 構文で、エラーが発生した行番号を取得できますか?
4 views (last 30 days)
Show older comments
MathWorks Support Team
on 14 Nov 2019
Answered: MathWorks Support Team
on 14 Nov 2019
try/catch ステートメントを使っています。エラーが発生した行番号を取得する方法を教えてください。
Accepted Answer
MathWorks Support Team
on 14 Nov 2019
try/catchステートメントで、エラーが発生した行番号を取得するには、MException オブジェクトにアクセスします。
例:
try
surf
catch ME
error_line = ME.stack(end).line % 行番号
end
以下の URLより関連ドキュメンテーションをご覧いただけます。
・MATLAB: 例外への応答
0 Comments
More Answers (0)
See Also
Categories
Find more on Exception Handling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!