When the constructor is called, it instantiates the object with any defaults given in the properties block ([] for any properties without defaults), so in my example above, a scalar object was already instantiated.
If c>2 the call
obj(c) = myClass(a,b);
requires MATLAB to fill in
obj(2:c-1)
with cheap copies (created by calling the constructor without arguments). Calling the empty method replaces the object with an empty array, so the call
obj(c) = myClass(a,b);
now acts as expected.
Another option would be to delete the default object before expanding it.
obj.delete
BTW: MATLAB states that an object is destroyed if its variable is assigned to a new value or when the function ends, so you do not need to free memory. http://www.mathworks.com/help/techdoc/matlab_oop/brfylzt-1.html#bsxw4_c