Breakpoints in code. Something equivalent to the Stop command in interpreted Basic.
35 ビュー (過去 30 日間)
古いコメントを表示
I'm wanting to put permanent breakpoints in code. Something equivalent to the Stop command in interpreted Basic. As with the Editor's breakpoints, I want the cursor to be at the interruption point. And I want to continue with F5. Any ideas?
0 件のコメント
採用された回答
Steven Lord
2017 年 3 月 6 日
Use the keyboard function.
3 件のコメント
Steven Lord
2017 年 3 月 6 日
If you have the Editor/Debugger preference "Automatically open files when MATLAB reaches a breakpoint" enabled (in the "General Preferences for the Editor/Debugger" section of this documentation page) it will automatically open the file in which the keyboard command is called to the line where it is called.
その他の回答 (1 件)
Walter Roberson
2017 年 3 月 6 日
編集済み: KSSV
2021 年 2 月 10 日
8 件のコメント
Ivan Nascimento
2021 年 7 月 8 日
編集済み: Ivan Nascimento
2021 年 7 月 8 日
Walter's STOP worked perfectly for me but only once I changed str2num to num2str, since dbstop receives a string as argument and ST(2).line is double. It works even when it is called before a comment or blank line (it stops in the next executable line, if it exists). Thank you, Walter!
EDIT. From dbstop help: To resume execution, use dbcont or dbstep. To exit from the debugger, use dbquit.
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!