Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Why does everyone hate 'eval'?
Date: Thu, 11 Dec 2008 23:39:04 +0000 (UTC)
Organization: Oxford University
Lines: 9
Message-ID: <ghs8ao$a3t$1@fred.mathworks.com>
References: <ghrlim$oqo$1@fred.mathworks.com> <ghromj$f8g$1@fred.mathworks.com> <ghrplu$4in$1@fred.mathworks.com> <see-38C92E.18085111122008@news.frontiernet.net>
Reply-To: <HIDDEN>
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 1229038744 10365 172.30.248.37 (11 Dec 2008 23:39:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 11 Dec 2008 23:39:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1073021
Xref: news.mathworks.com comp.soft-sys.matlab:506448

Doug wrote:
> If you really need to create variables you can use assignin inside a 
> function.  It should be safer and more readable than eval.
> 
>   function assign(varname,value)
>   assignin('caller',varname,value)

Thanks, Doug! I am doubly enlightened. :-)
Oliver