Breakpoints in code. Something equivalent to the Stop command in interpreted Basic.
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
John
el 6 de Mzo. de 2017
Editada: Ivan Nascimento
el 8 de Jul. de 2021
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 comentarios
Respuesta aceptada
Steven Lord
el 6 de Mzo. de 2017
Use the keyboard function.
3 comentarios
Steven Lord
el 6 de Mzo. de 2017
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.
Más respuestas (1)
Walter Roberson
el 6 de Mzo. de 2017
Editada: KSSV
el 10 de Feb. de 2021
8 comentarios
Ivan Nascimento
el 8 de Jul. de 2021
Editada: Ivan Nascimento
el 8 de Jul. de 2021
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.
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!