Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
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:01:34 +0000 (UTC)
Organization: Nationwide Mutual Insurance Co.
Lines: 39
Message-ID: <f8npte$1cd$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>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185901294 1421 172.30.248.36 (31 Jul 2007 17:01:34 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 31 Jul 2007 17:01:34 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642723
Xref: news.mathworks.com comp.soft-sys.matlab:421885



My version is 6.5.1.

The code is running OK now even though I have an older version. Don't know what went wrong before. However, the matrix dimension got changed. 

For example, if the dimension of the matrix is 5*9, when exporting it using dlmwrite function, it no longer appears as a 5*9 matrix in the output file. In your example, the 10*10 matrix became one single line in the output. Any way to keep the orginal dimension of matrix in the output?

Thanks,
Stephen
 
"us " <us@neurol.unizh.ch> wrote in message <f8nlam$3tv$1@fred.mathworks.com>...
> stephen:
> <SNIP version problem...
> 
> > That's what HELP says
> "dlmwrite(filename,M,delimiter,R,C) writes matrix A into an ASCII-format file, using delimiter to separate matrix elements...
> 
> bad news: you seem to have an older ML version(?)...
> 
> in r2007a it says:
> 
> DLMWRITE Write ASCII delimited file.
>     DLMWRITE('FILENAME',M) writes matrix M into
>          FILENAME using ',' as the delimiter to
>          separate matrix elements.
>     DLMWRITE('FILENAME',M,'DLM') writes matrix M into
>          FILENAME using the character DLM as the
>          delimiter.
> <...>
> 
> furthermore, this works as expected
> 
>      m=magic(10);
>      dlmwrite('foo.txt',m,'\t');
> 
> what version do you use?
> what error do you get?
>  
> us