try/catch 構文で、エラーが発生した行番号を取得できますか?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 14 Nov. 2019
Beantwortet: MathWorks Support Team
am 14 Nov. 2019
try/catch ステートメントを使っています。エラーが発生した行番号を取得する方法を教えてください。
Akzeptierte Antwort
MathWorks Support Team
am 14 Nov. 2019
try/catchステートメントで、エラーが発生した行番号を取得するには、MException オブジェクトにアクセスします。
例:
try
surf
catch ME
error_line = ME.stack(end).line % 行番号
end
以下の URLより関連ドキュメンテーションをご覧いただけます。
・MATLAB: 例外への応答
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Exception Handling finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!