Sorry about the previous message, I accidentally tried emacs line edits in gmail and sent the message ;)
I was playing around in Matlab R2007b and found something that may shed some light on what Matlab is doing. If I create
@Foo/Foo.m function f = Foo() f.dataelement = 'I am Foo'; f = class(f,'Foo');
Then in matlab
>> bar = Foo() ; >> save test.m bar >> exit
Next edit break @Foo/Foo.m
function f = Foo() f = [];
Then restart matlab
>> load test.mat Warning: Could not determine the fields for class Foo by calling the constructor with no input arguments. The object bar has been
converted to a structure. To eliminate the conversion create an object of class Foo before calling LOAD.
So, I think Matlab keeps an internal memory of each class structure. Probably the first time a class of a specific type is created, Matlab remembers the member information. If Matlab doesn't have member information it calls the constructor with no arguments. I'll do some more testing to verify.