MATLAB: Does the GUI code sometimes not update when debugging / making changes on the fly

guiMATLAB

I am writing another GUI for making my life easier when processing common datasets. This is without using guide or anything, just creating axes, tabs, buttons, etc using the uicontrol commands, then running various processing techniques within the GUI. My question (which has always bugged me), is why sometimes when I make a small change to code that the GUI uses, this change is not registered during debugging.
In fact, even if I close and reopen the GUI figure window, the code does not seem to update. It sometimes takes closing Matlab down completely, then reopening in order for the code change to "register". As an example, let's say I am plotting something and want to make a small change that plots an additional point or line or something. I press the button or interact with the GUI in whatever way re-runs that code, but nothing happens. If I run it in debug mode, sometimes it will skip the line entirely, but other times it will seem to step through the new code, just using wrong values (from a previous iteration or whatever). In these cases, it takes a whole shutting down and reopening of Matlab to get the code to behave the way I expect!
Is there some kind of underlying "compiling" that goes on during GUI generation that causes this issue? I have never seen behavior like this when simply running scripts, etc., only when working with GUIs. If there is some kind of compiling that goes on, is it possible to disable this or force it to "recompile" just by restarting the GUI (rather than all of Matlab)? Am I the only one experiencing issues like this? It's annoying when you are debugging and working out details of a GUI on a daily basis.

Best Answer

Use "clear" and the name of the function.
Yes, there is Just In Time Compiling. The function will normally be cleared automatically if MATLAB detects that the containing file is changed, but there are various ways that might not be detected.