help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there something quicker than textscan?


From: indium
Subject: Re: Is there something quicker than textscan?
Date: Mon, 19 Mar 2012 08:22:16 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Mar 19, 2012 at 12:25:17AM -0700, maiky76 wrote:
> Hi,
> 
> I have to load quite a few files from an analyzer (.txt with 4 columns of 
> 16384 lines of fft: freq, Gain, Phase and Coherence with plus a footer with
> the analyzer settings that i don't care about).
> 
> I use the following code in a loop to store the data before performing some
> calculation in the loop:
> 
> [...]
> 
> fid   = fopen(D_FR(k).name);
> data  = textscan(fid,'%f %f %f %f',16384); 
> fclose(fid);
> 
> FRTF_gain(:,k)        = data{1,2};
> FRTF_phase(:,k)  = data{1,3};
> FRTF_coh(:,k)     = data{1,4};
> 
> [...]
> 
> The slowest step by (very) far is the textscan process. 
> I average 85s per file with Octave 3.6.1 and 0.25s with Matlab 2010a.
> 
> Question: how could I load the data quicker than that in Octave?
> 
> Thanks
> M
> 

did you try dlmread() ? No idea if it's faster, though...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]