Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: error on running eval and save
Date: Fri, 6 Nov 2009 17:26:10 +0000 (UTC)
Organization: Mitre Corp
Lines: 29
Message-ID: <hd1m7i$d0q$1@fred.mathworks.com>
References: <hd1kba$dvr$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1257528370 13338 172.30.248.35 (6 Nov 2009 17:26:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 6 Nov 2009 17:26:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2318
Xref: news.mathworks.com comp.soft-sys.matlab:583062


"Kuo-Hsien" <mchangks@hotmail.com> wrote in message <hd1kba$dvr$1@fred.mathworks.com>...
> Dear all,
> 
> I stuck by my code for couple days. I come here to ask any guidance and suggestions. Please kindly point the problems and solutions out. Thanks. My purpose is to create new files contain NaNs <48x1 double> and the file names are named by date. The desired file names will be picking up from a <366x1 cell> tmp_filenames by ismember.  
> 
> The error message is:
> ??? Error using ==> eval
> Undefined function or method 'save20080101fillin' for input arguments of type 'char'.
> 
> What should I do? 
> 
> ----------------------------------
> [tf, index] = ismember(tmp_filenames,filename_4_compare);
> for n = 1:length(find(index == 0))
>     fillin_filename = [tmp_filenames(n)]
>     fillin_filename = cell2mat(fillin_filename)
>     fillin = ones(48,1) * NaN
>     eval(['save' ,fillin_filename ,'fillin -ascii'])
> end
> ----------------------------------
> index : <366x1 double>
> tmp_filenames : <366x1 cell>
> filename_4_compare : <10x1 cell>

% I think you need to add some spaces after save.
% replace:
     eval(['save' ,fillin_filename ,'fillin -ascii'])
% with
     eval(['save ' ,fillin_filename ,' fillin -ascii'])