Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Newbie fopen() question

Cingulate wrote:

> This might be a really simple question but fopen doesn't seem to like
> the concatenated string I'm passing it and spits out an "Invalid
> filename" error when in fact the filename does exist. (I tried opening
> it explicitly from the command prompt and it worked.)
> Can anybody tell me what I may be doing wrong ?
> Thanks.
> 
> 
> 
> datadirstem ='/xxx/yyy/';
> subjs = {'a';'b';'c';}
> for i=1:3
> 
>      fname = strcat(datadirstem, subjs(i),'suffix')
> 
>      fid = fopen(fname, 'r');
> 
> end

'suffix': should this be a variable and hence passed without apostrophes?

Have you considered cd(datadirstem)? Maybe MATLAB does not handle paths
well...

What error do you get?

Roy

-- 
Roy Schestowitz
http://schestowitz.com

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index