How to format matrix data correctly in an output text file?

15 ビュー (過去 30 日間)
Jared Rigby
Jared Rigby 2012 年 3 月 20 日
Hi,
I'm having trouble with some code that exports numeric data from a matrix to a text file.
The code is as follows:
dlmwrite([folder '\' rename '.txt'], rawdata, 'delimiter', '\t', 'precision', 4);
The problem is the text file displays data as:
1 2 3 4 5 67 8 9 10 11 1213 14 15 16 17 18...
As opposed to:
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
etc...
Any suggestions?
Thanks,
Jared.

採用された回答

Jared Rigby
Jared Rigby 2012 年 3 月 20 日
I was just missing a couple of extra settings for dlmwrite
dlmwrite([folder '\' rename '.txt'], rawdata, 'delimiter', '\t', 'precision', 4, 'newline', 'pc');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by