Path: news.mathworks.com!not-for-mail
From: "Yuri Geshelin" <geshelin@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: eval, feval, global
Date: Thu, 27 Mar 2008 18:08:02 +0000 (UTC)
Organization: Bedford Institute of Oceanography
Lines: 28
Message-ID: <fsgnq2$dfc$1@fred.mathworks.com>
References: <fsebf0$43u$1@fred.mathworks.com> <fsg56d$50c$1@fred.mathworks.com> <fsgmf0$fcd$1@fred.mathworks.com> <fsgms3$nv8$1@fred.mathworks.com>
Reply-To: "Yuri Geshelin" <geshelin@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1206641282 13804 172.30.248.37 (27 Mar 2008 18:08:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 27 Mar 2008 18:08:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1149396
Xref: news.mathworks.com comp.soft-sys.matlab:459522


"us " <us@neurol.unizh.ch> wrote in message <fsgms3$nv8
$1@fred.mathworks.com>...
> "Yuri Geshelin":
> <SNIP evil eval evergreen...
> 
> > eval(['plot(A.' prop{irf} ')'])
> > What would be your recommendation
> 
> one of the solutions
> 
>      a.b=1:10;
>      a.cc=1+a.b;
>      a.ddd=2+a.b;
>      f={'b','cc','ddd'};
>      plot(a.(f{1}));
>      hold on;
>      plot(a.(f{2}));
> 
> us

Thanks us,

for filling yet another gap in my knowldege of matlab. I 
did not know that a.(f{3}) is a valid reference to a 
structure's field. No more questions.

Yuri