MATLAB: Problem with debugger (Heisenberg Uncertainty Principle?)

debuggui

I'm having a problem with my debugger not syncing up with what my program actually does. Specifically when I run my program I find some problems with the output, but when I enter the debugger and run it, I find the output at the end is exactly what I want. It's as if attempting to observe the problem makes it disappear (HUP).
My code is quite complicated, and the potential error could be occurring (and not occurring) in any one of many places, so I've decided not to post any code snippets. Since it works in the debugger, I assume my code itself is sound and the problem lies with Matlab somehow. I can tell you that is a GUI and that the general problem lies in updating the handles object. I am using Matlab r2006b on Windows 7 64 bit.
Has anyone else experienced a problem like this?

Best Answer

Thanks guys for the answers. I solved the problem. It was an issue with the guidata function. I was calling guidata(gcf, handles) and when I was in debug mode gcf was the figure I wanted, however when I was out of debug mode gcf was something else (not sure what). The correct call that I'm now making is guidata(handles.figure1, handles).
Related Question