Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在调试 MATLAB 代码时,如果我dbstep在下一条语句是函数调用时调用,则调试器会跳过函数调用到当前 m 文件中的下一行代码。如何进入函数调用?我正在寻找像nextgdb 中的函数。
dbstep
next
例子
源文件:
=> b = foo(a); c = bar(b);
我打电话dbstep:
b = foo(a); => c = bar(b);
我想要的是:
function out = foo (a) => out = baz(a);
nextgdb命令的 MATLAB 替代方法是dbstep in.
dbstep in
如果您使用 GUI,另一种选择是学习键盘快捷键,这对我逐步执行代码非常有帮助。
进入调试模式后,使用 F10 将逐行浏览当前文件。如果您想单步执行某个功能,只需使用 F11。跳出是shift+F11,F5会跑到最后。