Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!uns-out.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!fe109.usenetserver.com.POSTED!33b9410e!not-for-mail
From: Doug Schwarz <see@sig.for.address.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Call all methods of an object
References: <g0pohu$sji$1@fred.mathworks.com> <g0qfcu$tp$1@fred.mathworks.com> <g0sh6p$2pq$1@fred.mathworks.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: MT-NewsWatcher/3.5.2 (Intel Mac OS X)
Message-ID: <see-B0284A.22131819052008@softbank060082049208.bbtec.net>
Lines: 51
X-Complaints-To: abuse-news@frontiernet.net
NNTP-Posting-Date: Mon, 19 May 2008 22:13:19 EDT
Organization: Frontier
Date: Mon, 19 May 2008 22:13:18 -0400
Xref: news.mathworks.com comp.soft-sys.matlab:469379


In article <g0sh6p$2pq$1@fred.mathworks.com>,
 "per isakson" <poi.nospam@bimDOTkthDOT.se> wrote:

[snip]

> Doug, I cannot find the text you refer to. The matter ought 
> to be treated in &#8220;MATLAB? 7 Classes and Object-Oriented 
> Programming&#8221; on page 7-9 or close. 

I found it.  Quoting from matlab_oop.pdf for R2008a, beginning on page 
7-10:


Referencing Names with Expressions‹Dynamic Reference

You can reference an object¹s properties or methods using an expression 
in dot-parentheses syntax:

  obj.(expression) 

The expression must evaluate to a string that is the name of a property 
or a method. For example, the following statements are equivalent:

  obj.Property1 
  obj.('Property1')

In this case, obj is an object of a class that defines a property called 
Property1. Therefore, you can pass a string variable in the parentheses 
to reference to property:

  propName = 'Property1';
  obj.(propName)

You can call a method and pass input arguments to the method using 
another set of parentheses:

  obj.(expression)(arg1,arg2,...)

Using this notation, you can make dynamic references to properties and 
methods in the same way you can create dynamic references to the fields 
of structs (see ³Using Dynamic Field Names² for information on MATLAB 
structures).



Per, I don't think you are looking at the right document.

-- 
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.