【发布时间】:2015-12-01 18:27:39
【问题描述】:
当我调试较长的数字代码时,我经常希望在发生某些事情时或在特定的迭代中查看函数变量值。通常我会这样做:
function banana(platano)
% long stuff here
for ii=1:123456789
% tons of maths
if ii==45612
stophere=1; % I put a break point in this line of code
end
end
但是,这需要我在函数中编写代码进行调试,而且看起来不太好。有没有更聪明的方法来做到这一点?
【问题讨论】: