MATLAB: The class file for … has been changed; but the change cannot be applied because objects based on the old class file still exist.

classoop

I typically get this warning after editing a class and it is very familiar to me. In particular, I also know that deleting all instances of a class or issuing "clear classes" gets rid of this warning. However, I am wondering if there is any more specific information available about when not clearing the class is really dangerous.
For example, I find that simply editing a class method never seems to produce any ill consequences. The changes I make to the method always seem to go through in spite of the warning. Can I always count on this? Might it only be changes to properties and class attributes that matter?
It would be convenient if that were the case. 99% of the time, I invoke this warning due to editing a class method while objects of the class are still in the workspace. It would be nice to know that I can safely ignore the warning, since deleting/reconstructing instances of the class every time I need to revise a class method is somewhat of a bother.

Best Answer

I don't know for sure but
  • I have not seen any "any more specific information "
  • After adding (or renaming) methods or properties clear classes is required; i.e. after changing info in the meta-data.
  • After editing code inside methods it is safe to ignore the warning.
.
2013-08-06. I just stumbled upon some "more specific information "
I think it confirms my description.
Related Question