[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File size limits in textread()?
From: |
Keith Goodman |
Subject: |
Re: File size limits in textread()? |
Date: |
Fri, 10 Jun 2005 10:20:59 -0700 |
On 6/10/05, Stefan van der Walt <address@hidden> wrote:
> Here's a much faster version of the code posted earlier.
Wow. It is fast. Can someone change the output of tread to be a matrix
for numbers instead of a cell (see below)?
>> fid = fopen("x","wb");
>> text = "1 2 a b\n";
>> for i = 1:6000;fprintf(fid,text);end
>> fclose(fid);
>> tic; [d1,d2,s1,s2] = textread("x","%d %d %s %s"); toc
ans = 11.860
>> tic; [d12,d22,s12,s22] = tread("x","%d %d %s %s"); toc
ans = 0.086523
>> isequal(s1,s12)
ans = 1
>> isequal(d1,d12)
error: binary operator `==' not implemented for `matrix' by `cell' operations
error: evaluating binary operator `==' near line 54, column 22
error: evaluating argument list element number 1
error: evaluating assignment expression near line 54, column 9
error: evaluating if command near line 27, column 5
error: evaluating for command near line 25, column 3
error: called from `isequal' in file
`/usr/local/share/octave/2.9.3/site/m/octave-forge/general/isequal.m'
>> whos d1 d12
*** local user variables:
Prot Name Size Bytes Class
==== ==== ==== ===== =====
rwd d1 1x6000 48000 matrix
rwd d12 1x6000 48000 cell
Total is 12000 elements using 96000 bytes
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------