How can I print each matrix row on a separate line when using DLMWRITE in MATLAB 7.10 (R2010a)?
Show older comments
I am trying to print a matrix to a text file using the DLMWRITE function as in the example below:
M = [1 ;2 ;3 ;4 ; 5]
dlmwrite('myfile.txt', M, 'delimiter', '\t');
The file is created correctly, but when I open it using Notepad, I see all the matrix elements printed on a single line rather than each element being printed on a separate line. How can I ensure that each row in the matrix is printed on a separate line?
Accepted Answer
More Answers (0)
Categories
Find more on Text Data Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!