Thread Subject: how to read these files simultaneously, round one of them

Subject: how to read these files simultaneously, round one of them

From: Joe Frank

Date: 17 Mar, 2009 16:52:00

Message: 1 of 3

Hello,

I have a function as below.. I need to read the files in this listed function and round one of the two files.

Its as below,

function fileList = GetFilenameList()

fileList(1).play = 'B:\abc101.csv';
fileList(1).stop= 'B:\bcd121.csv';

fileList(2).play = 'B:\ebs132.csv';
fileList(2).stop= 'B:\dcm481.csv';

fileList(3).play = 'B:\xya160.csv';
fileList(3).stop= 'B:\dms151.csv';

Now I need to read all the three files one by one.. while doing so I will have to round off the values of only "PLAY" files.. How do I do this?

Thanks,
Joe

Subject: how to read these files simultaneously, round one of them

From: Joe Frank

Date: 17 Mar, 2009 17:34:01

Message: 2 of 3

"Joe Frank" <sascod@gmail.com> wrote in message <gpokfg$rla$1@fred.mathworks.com>...
> Hello,
>
> I have a function as below.. I need to read the files in this listed function and round one of the two files.
>
> Its as below,
>
> function fileList = GetFilenameList()
>
> fileList(1).play = 'B:\abc101.csv';
> fileList(1).stop= 'B:\bcd121.csv';
>
> fileList(2).play = 'B:\ebs132.csv';
> fileList(2).stop= 'B:\dcm481.csv';
>
> fileList(3).play = 'B:\xya160.csv';
> fileList(3).stop= 'B:\dms151.csv';
>
> Now I need to read all the three files one by one.. while doing so I will have to round off the values of only "PLAY" files.. How do I do this?
>
> Thanks,
> Joe

Somebody please reply

Subject: how to read these files simultaneously, round one of them

From: Walter Roberson

Date: 17 Mar, 2009 20:18:53

Message: 3 of 3

Joe Frank wrote:

> I have a function as below.. I need to read the files in this listed function and round
> one of the two files.

Your posting title requests that they be read "simultaneously", but you do not
mention that in the body of the message. If simultaneous is in fact required then
you will need to define what you mean by simultaneous. For example, do you have six
independent disk I/O controllers available to you so that the disk controllers could
each be servicing one file while the others are occupied, leading to simultaneous
in that sense? And are those I/O controllers attached to a system that can do six
simultaneous DMA (direct memory accesses) so that the data can be transferred from
the disk simultaneously? And do you have a real-time operating system available to
you so that the operating system really does issue all of the I/O and DMA commands
at the same time, rather than sequentially, one system call per read request?

 
> Its as below,
>
> function fileList = GetFilenameList()
>
> fileList(1).play = 'B:\abc101.csv';
> fileList(1).stop= 'B:\bcd121.csv';
>
> fileList(2).play = 'B:\ebs132.csv';
> fileList(2).stop= 'B:\dcm481.csv';
>
> fileList(3).play = 'B:\xya160.csv';
> fileList(3).stop= 'B:\dms151.csv';
>
> Now I need to read all the three files one by one..

I could 6 different files listed there, not three files??

> while doing so I will have to round off the values of only "PLAY" files.. How do I do this?

What do you mean by rounding off a file? And why not just loop

nfid = length(fileList);
outdata = cell(nfid, 2);
for K = 1:nfid
  pfid = fopen(fileList(K).play, 'rt');
  outdata{K,1} = textscan(pfid, SomeAppropriateFormatHere);
  fclose(pfid);
  sfid = fopen(fileList(K),stop, 'rt');
  outdata{K,2} = textscan(sfid, SomeOtherAppropriateFormatHere);
  fclose(sfid);
end

for K = 1:nfid
  outdata{K,1} = AppropriateRoundingFunction(outdata{K,1});
end

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com