MATLAB: Update Class without restarting matlab

class refreshclass updateoop

Hello Matlabers
I am working on a GUI and have implemented some of my own classes (all stored in @classname folder with subfunctions in there too – as told on the mathworks website).
When I need to do some changes to methods/functions in my classes, they somehow do not get updated after saving. When I restart my gui (where tha objects are created) I still get the old implementations.
I always close all the windows/guis and do "close all" but this does not seem to work – even "pack" has no influence.
Thus I found that in order to have an updated class I need to restart my Matlab and then things work perfectly.
There has to be a more convenient way, hasn't it?

Best Answer

This is because Matlab does a certain amount of cacheing of classes in memory - as indicated by Walter the way to update is to use
clear classes