Path: news.mathworks.com!not-for-mail
From: "Jetson Ronald" <ajetsonronald@yahoo.co.in>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Multiple input file analysis
Date: Sat, 20 Feb 2010 11:51:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 53
Message-ID: <hloib8$3oi$1@fred.mathworks.com>
References: <hln27t$shc$1@fred.mathworks.com> <hlnbrc$2pv$1@fred.mathworks.com>
Reply-To: "Jetson Ronald" <ajetsonronald@yahoo.co.in>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1266666664 3858 172.30.248.37 (20 Feb 2010 11:51:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 20 Feb 2010 11:51:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2125354
Xref: news.mathworks.com comp.soft-sys.matlab:610016

Dear Sadik 

i tried with your suggestions.
It works amazingly well!!!!!
Thanks a lot
Jet


"Sadik " <sadik.hava@gmail.com> wrote in message <hlnbrc$2pv$1@fred.mathworks.com>...
> Hi Jetson,
> 
> You should first filter out the ones finishing with "-N":
> 
> listOfNorthFiles = dir('*-N.*');
> 
> [In the following, I will assume your files have a three-letter extension like .txt]
> 
> Then, in a for loop, you can use your files in a pair like this:
> 
> for pairCounter = 1:length(listOfNorthFiles)
>     northFileName = listOfNorthFiles(pairCounter).name;
>     eastFileName = [northFileName(1:end-6) '-E' northFileName(end-3:end)];
> 
>     fidNorth = fopen(northFileName,'r');
>     fidEast = fopen('eastFileName','r');
>  
>     % Do whatever you want with the files. Read data, process, etc.
>  
>     fclose(fidNorth);
>     fclose(fidEast);
> end
> 
> % That's it. Best.
> "Jetson Ronald" <ajetsonronald@yahoo.co.in> wrote in message <hln27t$shc$1@fred.mathworks.com>...
> > Hell
> >       I have set of input files in a folder. The name of the files in the folders are like
> > CHY023-N,
> >  CHY023-E,
> > CHY143-E, 
> > CHY143-N,
> > CHY153-E,
> >  CHY153-N,
> > TCU043-E, 
> > TCU043-N,
> > TCU063-E,
> >  TCU063-N ................
> > They are earthquake records in a staion in two dorection such as east and north. I want to rotale the records in other direction using the following formula
> >    R=E.*cos(q)+N.*sin(q);
> >     T=-E.*sin(q)+N.*cos(q);
> > I am able to access all the records using dir comment but my program should be able to read the pairs that is east and north directions records for a station together (CHY143-N,CHY153-E) then next pair. Whant i mean is it should read the records in a station simultaniously.
> > 
> > Regards
> > Jet