Re: how to write a matlab matrix to a txt file
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Fri, 29 Jun 2007 21:11:46 +0000 (UTC)
In article <ef5c1ff.-1@xxxxxxxxxxxxxxxxxxxxxxx>,
kadir <kkirtacremovethis@xxxxxxxxx> wrote:
Hi, i try to use fwrite function but it changes the data format and
when i open the file via notepad , some weird characters shown.
fprintf function also writes the matrix as a column or row vector to
a txt file, a 200x3 matrix becomes 600x1 in the txt file. So, how can
i write the matlab data "as is" to a txt file ? thnx
4. FPRINTF is "vectorized" for the case when A is nonscalar. The
format string is recycled through the elements of A (columnwise)
until all the elements are used up. It is then recycled in a similar
manner through any additional array arguments.
So try something like
fprintf(outputstream, [repmat('%f ', 1, size(A,2)), '\n'], A');
--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
.
- References:
- how to write a matlab matrix to a txt file
- From: kadir
- how to write a matlab matrix to a txt file
- Prev by Date: Re: Matlab 7.4 OSX
- Next by Date: fopen assistance requested.
- Previous by thread: how to write a matlab matrix to a txt file
- Next by thread: mexAtExit
- Index(es):
Relevant Pages
|