Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Downsampling very large text file
Replies: 7   Last Post: Apr 18, 2013 9:02 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
bram

Posts: 4
Registered: 4/10/13
Re: Downsampling very large text file
Posted: Apr 18, 2013 4:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"bram " <b.schrier@student.tudelft.nl> wrote in message <kkob28$3qg$1@newscl01ah.mathworks.com>...
> Oops its not working like it should.
>
> Im getting all NaN's
>
> Firstly i made a mistake in the formatting of the txt file:
>
> It is actually formatted:
>
> Value1 Value2 Value1 Value3 Value1 Value4 ... Value1 Value9
>
> Pairs have one space in between, 3 tabs between pairs
>
> Will changing '\t' to ' ' work or will i have to enter all formatting?
>
> Secondly does %f handle values like this: 1.896875e-001?
>
> Thanks for the help so far,
>
> Bram


Ive tried removing the delimiter part since the default is all types of white spaces but it has no effect.

Further: the script seems to not stop at the ens of the text file. i'm testing with a smaller file but it doesnt stop...

code:

NtoAvg = 20; % how many records for each average
m=zeros(20,16);
fmt=repmat('%f',1,16);
i=0;
fid=fopen('exportrun12_short.txt','rt');
while ~feof(fid)
C=textscan(fid,fmt,NtoAvg,'collectoutput',1);
i=i+1;
m(i,:)=mean(C{:})
end
fid=fclose(fid);



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.