Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: eval, feval, global
Date: Thu, 27 Mar 2008 17:52:03 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 17
Message-ID: <fsgms3$nv8$1@fred.mathworks.com>
References: <fsebf0$43u$1@fred.mathworks.com> <fsg56d$50c$1@fred.mathworks.com> <fsgmf0$fcd$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1206640323 24552 172.30.248.35 (27 Mar 2008 17:52:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 27 Mar 2008 17:52:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:459517


"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