Path: news.mathworks.com!not-for-mail
From: Loren Shure <loren@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Call all methods of an object
Date: Mon, 19 May 2008 07:51:19 -0400
Organization: The MathWorks
Lines: 46
Message-ID: <MPG.229b33c4f54fbe79989854@news.mathworks.com>
References: <g0pohu$sji$1@fred.mathworks.com> <g0qfcu$tp$1@fred.mathworks.com> <a8af7cd9-686d-422f-afd6-1f184e74bb23@m3g2000hsc.googlegroups.com>
NNTP-Posting-Host: shurel.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
X-Trace: fred.mathworks.com 1211197879 23324 172.31.57.117 (19 May 2008 11:51:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 May 2008 11:51:19 +0000 (UTC)
User-Agent: MicroPlanet-Gravity/2.70.2067
Xref: news.mathworks.com comp.soft-sys.matlab:469217


In article <a8af7cd9-686d-422f-afd6-1f184e74bb23
@m3g2000hsc.googlegroups.com>, imageanalyst@mailinator.com says...
> On May 18, 7:50=A0pm, "Steven Lord" <sl...@mathworks.com> wrote:
> > "per isakson" <poi.nos...@bimDOTkthDOT.se> wrote in message
> >
> > news:g0pohu$sji$1@fred.mathworks.com...
> >
> > > The tool for Unit Testing that I use, MUNIT (xtargets),
> > > doesn't work under R2008a. Now I'm looking for a
> > > replacement.
> >
> > > In such a tool one need to run all tests in a file, which
> > > might be implemented as invoking "all" methods of an
> > > object. What would be the best way to do that? The feature
> > > demonstrated by this example looks useful. However, is it
> > > documented?
> >
> > I'd do this using the METHODS function to obtain the list of methods, t=
hen
> > use FEVAL to evaluate the method or use STR2FUNC to create a function h=
andle
> > to the method and invoke that using the regular functionHandle() syntax=
.
> >
> > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/methods.html
> >
> > --
> > Steve Lord
> > sl...@mathworks.com
>=20
> -------------------------------------------------------
> If you don't know the methods in advance, and have to get their names
> from the METHODS function, then how do you know what arguments to pass
> to those methods?  Calling a method without passing it the proper
> arguments will likely cause an exception.
>=20

You may be able to use nargin and nargout to help with this, but it's=20
not a full solution:

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/nargin.html


--=20
Loren
http://blogs.mathworks.com/loren/