On Fri, Aug 14, 2009 at 1:05 PM, Jaroslav Hajek
<address@hidden> wrote:
OK, here are some:
* A class is constructed from a struct. Can the struct be
multidimensional? (if the answer is no, then there is no need to read
further).
Apparently, yes. But, it seems to come out as an array of objects.
@foo/foo.m:
function obj = foo()
obj(10).data = 1 ;
obj = class(obj,'foo') ;
end
Then in matlab (I edited the whitespace):
>> a = foo()
a = foo object: 1-by-10
>> b = a(1)
b = foo object: 1-by-1
>>
Now I created
@bar/bar.m
function obj = foo()
obj.data = 1 ;
obj = class(obj,'foo') ;
end
>> b = bar()
??? Error using ==> class
Size of struct array being made into an object and the parent objects must be consistent.
Error in ==> bar.bar at 4
obj = class(obj,'bar',parent) ;
>>