Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: error on running eval and save
Date: Sun, 8 Nov 2009 18:17:59 -0500
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <hd7jhc$d93$1@fred.mathworks.com>
References: <hd1kba$dvr$1@fred.mathworks.com> <hd1nog$jp4$1@fred.mathworks.com> <hd5fm7$5sc$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1257722220 13603 172.31.44.65 (8 Nov 2009 23:17:00 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Nov 2009 23:17:00 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:583425



"Kuo-Hsien" <mchangks@hotmail.com> wrote in message 
news:hd5fm7$5sc$1@fred.mathworks.com...
> Hi Steve, it works!! Thanks. One more question: if I like to save the 
> files to a desired path, such as: /Users/cks/Documents/Matlab/
>
> And, I also set a path for the desired path as: pathway = 
> '/Users/cks/Documents/Matlab/'
>
> How to modify the following code correctly?
> eval(['save pathway/fillin_filename', 'fillin -ascii'])

DON'T USE EVAL IN THIS CASE.

Separate the construction of the file name (which will use some of the 
string processing functions) from the SAVE call.

realfilename = [pathway filename];
% or use FULLFILE

save(realfilename, 'filln', '-ascii')

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ