How to export a matrix in a text file?

Illustration
Kimayaojja - 2020-07-28T12:58:45+00:00
Question: How to export a matrix in a text file?

I want to save a matrix in a text file with the data organised in columns. Exemple: A= 1 2 3 4 5 6 I want to get a text file in which A looks like : A= 1 2 3 4 5 6 When I used the following function dlmwrite('dataexport.txt',a,'delimiter','\t'), I get a text file with A=1 2 3 4 5 6

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

A=[1 2
3 4
5 6]
dlmwrite('dataexport.txt',A,'delimiter','\t','newline','pc')


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!