On Thu, Apr 23, 2009 at 12:10 PM, John W. Eaton
<address@hidden> wrote:
On 23-Apr-2009, Judd Storrs wrote:
| ??? Error using ==> class
| Number of fields for class Foo cannot be changed without clear classes.
What if you just change the name of a field, but leave the number of
fields the same? Does that also generate an error (I hope the answer
is yes).
Yes,
??? Error using ==> class
Field names and parent classes for class Foo cannot be changed without clear classes.
Details:
Starting with @Foo/Foo.m:
function f = Foo()
f.dataelement = 'I am Foo';
f = class(f,'Foo');
>> bar = Foo() ;
>> struct(bar)
ans = dataelement: 'I am Foo'
Outside Matlab change @Foo/Foo.m:
function f = Foo()
f.newelement = 'I am a different Foo';
f = class(f,'Foo');
>> bar = Foo() ;
??? Error using ==> class
Field names and parent classes for class Foo cannot be changed without clear classes.
Error in ==> Foo.Foo at 3
f = class(f,'Foo');
--judd