clear classes
is not recommended. If you modify a
class definition, MATLAB automatically updates it. You do not need to clear
classes to instantiate objects using the new definition.
In addition to clearing class definitions, clear classes
also clears variables, scripts and functions. Using clear
classes
causes MATLAB to recompile previously cached code, and can
decrease performance.
When possible, remove or replace instances of clear classes
in your code.
To instantiate an object with an updated class definition, it is not necessary to clear classes.
To clear a particular class, consider clearing only the specific
class. For example, clear
myClass
.
For more information, see Automatic Updates for Modified Classes.