Write a matrix to a text file

1 view (last 30 days)
alkaabi
alkaabi on 9 Apr 2014
Commented: alkaabi on 9 Apr 2014
Please I need help! I have a code that produces a matrix 50*50 and it only contaiedn number 1s and zeros. I want this matrix to be transfered to a text file as simple as that. I want it to be 50 columes and 50 rows seperated by one space.
thank you very much

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 9 Apr 2014
Edited: Azzi Abdelmalek on 9 Apr 2014
dlmwrite('file.txt',your_matrix)
or
dlmwrite('file.txt',your_matrix,'delimiter','\t','newline','pc')

More Answers (0)

Community Treasure Hunt

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

Start Hunting!