How to export a matrix with the first row telling names of columns
like
A=
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
export to matrix.txt
x1 x2 x3 x4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
I was checking
dlmwrite('matrix.txt',A,'delimiter',',');
But how to modify it?
Use the ‘-append’ option: