When I debug long pieces of numerical code, often I want to see the function variable values if something happens, or in an specific iteration. Generally I do:
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
However, this requires me to write code in the function for debugging and it doesn't look nice. Is there a smarter way of doing this?
