Path: news.mathworks.com!not-for-mail
From: "stephen " <huangj5@nationwide.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Writing formatted text files when column number of the ouput is uncertain?
Date: Tue, 31 Jul 2007 17:44:11 +0000 (UTC)
Organization: Nationwide Mutual Insurance Co.
Lines: 28
Message-ID: <f8nsdb$f9e$1@fred.mathworks.com>
References: <f8ndon$pv1$1@fred.mathworks.com> <f8nhli$gok$1@fred.mathworks.com> <f8nj0u$eig$1@fred.mathworks.com> <f8njnb$2ke$1@fred.mathworks.com> <f8nkns$mht$1@fred.mathworks.com> <f8nlam$3tv$1@fred.mathworks.com> <f8npte$1cd$1@fred.mathworks.com> <f8nr4l$kb3$1@fred.mathworks.com>
Reply-To: "stephen " <huangj5@nationwide.com>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185903851 15662 172.30.248.35 (31 Jul 2007 17:44:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 31 Jul 2007 17:44:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642723
Xref: news.mathworks.com comp.soft-sys.matlab:421892


The output can be read the way you described as long as the output size is small. 

However, when the output is too big to be read either in excel or in matlab, you have to open the text file and read the output, which is kind of difficult as the dimension of the matrix is messed up in the text file.

Stephen
"us " <us@neurol.unizh.ch> wrote in message <f8nr4l$kb3$1@fred.mathworks.com>...
> stephen :
> <SNIP <dlmwrite> conundrum...
> 
> > In your example, the 10*10 matrix became one single line in the output...
> 
> this is how it looks here (r2007a)
> 
>      m=reshape(1:8,2,4);
>      dlmwrite('foo.txt',m,',');
>      m
>      type foo.txt
> %{
> m =
>      1     3     5     7
>      2     4     6     8
> 
> 1,3,5,7
> 2,4,6,8
> %}
> 
> us