Breakpoints in code. Something equivalent to the Stop command in interpreted Basic.
조회 수: 34 (최근 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!