Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: read ascii file
Date: Mon, 10 Nov 2008 13:53:01 +0000 (UTC)
Organization: Pierburg GmbH
Lines: 11
Message-ID: <gf9ebt$i8q$1@fred.mathworks.com>
References: <gf909u$4n9$1@fred.mathworks.com> <e2d1e726-82c5-4d32-865d-ab0700e0f092@r36g2000prf.googlegroups.com> <gf9b2u$bon$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226325181 18714 172.30.248.35 (10 Nov 2008 13:53:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 10 Nov 2008 13:53:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872224
Xref: news.mathworks.com comp.soft-sys.matlab:499937


on the speed...
.
for a 1000x1000 matrix file counting from 1 to 1e6 ('{{1,2,3,...', ~6.7Mb),
.
tic
B = txt2mat('ds_1000.txt',0,-1,'ReplaceChar',{'{}, '});
n = sqrt(numel(B));
B = reshape(B,n,n).';
toc
.
takes about one second. (The "0,-1" args switch off the file layout detection which is necessary for lines >64kB)