Path: news.mathworks.com!not-for-mail
From: "jay vaughan" <jvaughan5.nospam@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: eval begone!  (part 2)
Date: Mon, 21 Apr 2008 21:34:02 +0000 (UTC)
Organization: harvard
Lines: 29
Message-ID: <fuj189$h0i$1@fred.mathworks.com>
References: <fuiqo8$heq$1@fred.mathworks.com> <fuir6s$r1r$1@canopus.cc.umanitoba.ca>
Reply-To: "jay vaughan" <jvaughan5.nospam@gmail.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 1208813642 17426 172.30.248.37 (21 Apr 2008 21:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 21 Apr 2008 21:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1215048
Xref: news.mathworks.com comp.soft-sys.matlab:464413


Thanks (again), Walter.

str2func did the trick very nicely and tipped me off on a
useful tool for the future.


J


roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fuir6s$r1r$1@canopus.cc.umanitoba.ca>...
> In article <fuiqo8$heq$1@fred.mathworks.com>,
> jay vaughan <jvaughan5.nospam@gmail.com> wrote:
> >I am continuing the process of purging eval statements from
> >my code, but got stuck on another one.
> 
> >func_basename = 'my_func';
> >FileName = uigetfile;
> >func_name = get_most_recent_func(func_path, func_basename);
> >eval([func_name '(''' FileName ''')']);
> 
> func_handle = str2func(func_name);
> func_handle(FileName);
> -- 
>   "Is there any thing whereof it may be said, See, this is
new? It hath
>   been already of old time, which was before us."    --
Ecclesiastes