comp.soft-sys.matlab
[Top] [All Lists]

subsref

Subject: subsref
From: Gucky
Date: Fri, 30 Sep 2005 10:31:19 -0400
Newsgroups: comp.soft-sys.matlab
Hi!

I have a problem with overloading SUBSREF

I have an object A with e.g. two members like A.name and A.age, if I
have vector of this objects my program make this vector to an object
of the type A. But if I want to call now A(2) it is (of course) not
possible, because A is one object. So I thought I overload subsref in
a way, that this call a routine in subsref, which extract all the
data of A, which is part of the previous second element.
But the main problem is, that A(2) and e.g. A.name(2) are calling
both the same ( ) operator, is there a way to find out if there is a
"." before or after the ()?
Or have someone another idea to handle that problem?

Thank you for helping!

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy