Path: news.mathworks.com!not-for-mail
From: "Walter Roberson" <roberson@ibd.nrc-cnrc.gc.ca>
Newsgroups: comp.soft-sys.matlab
Subject: Re: URGENT: Read text file and save matrices
Date: Tue, 14 Oct 2008 03:09:01 +0000 (UTC)
Organization: National Research Council of Canada
Lines: 17
Message-ID: <gd12gd$brs$1@fred.mathworks.com>
References: <gd0i5s$abm$1@fred.mathworks.com> <gd0klu$3ea$1@fred.mathworks.com> <gd0l0c$s3h$1@aioe.org>
Reply-To: "Walter Roberson" <roberson@ibd.nrc-cnrc.gc.ca>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223953741 12156 172.30.248.38 (14 Oct 2008 03:09:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 14 Oct 2008 03:09:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 434782
Xref: news.mathworks.com comp.soft-sys.matlab:494995


dpb <none@non.net> wrote in message <gd0l0c$s3h$1@aioe.org>...
> Diego Zegarra wrote:
> > p.d. I am not asking you to code all this for me, an explanation or a
> > guide would be really appreciated

> help iofun
> help textread

I would think textscan() would be more appropriate for
the problem than textread().

After the first two lines are read, you know the number and sizes of the additional matrices. You can construct format strings for textscan() using
FormatString = repmat('%f', 1, NumberPerLine);
and then you can apply it as

MatrixIn = textscan(fid, FormatString, NumberOfLines, ...
'CollectOutput', true);