Since you're not providing much info, let me show what I get with a simple example running on R2014a. Consider the following class:
MyClass.m
classdef MyClass
properties
x
end
end
First I create an object of this class:
>> a = MyClass()
a =
MyClass with properties:
x: []
Next I modify the above by adding a new property y
, and saving the MyClass.m
file:
MyClass.m (after change)
classdef MyClass
properties
x
y %# <-- added
end
end
Now if I try to create another instance of the class, I get the following warning:
>> b = MyClass()
Warning: The class file for 'MyClass' has been changed, but the change cannot be applied because objects
based on the old class file still exist. If you use those objects, you might get unexpected results. You
can use the 'clear' command to remove those objects. See 'help clear' for information on how to remove
those objects.
b =
MyClass with properties:
x: []
As indicated, we won't see the changes until we clear all instances of the old class:
>> whos
Name Size Bytes Class Attributes
a 1x1 104 MyClass
b 1x1 104 MyClass
>> clear classes
>> whos
>> b = MyClass()
b =
MyClass with properties:
x: []
y: []
Now the modifications are picked up by the new object.
Note that in some cases, MATLAB might still hold references to objects not visible in the base workspace (like if you have globals, locked functions, or GUIs with data saved in the app/user data section of the GUI). Usually closing all figures and clearing all variables will remedy the situation. If not, restarting MATLAB will most definitely get could back to a clean slate.