Write comma-separated value file
csvwrite(filename,M)
csvwrite(filename,M,row,col)
csvwrite(filename,M)
writes
matrix M
into filename
as comma-separated
values. The filename
input is a character vector
specified as text enclosed in single quotes, for example, 'csvlist.dat'
.
csvwrite(filename,M,row,col)
writes
matrix M
into filename
starting
at the specified row and column offset. The row and column arguments
are zero based, so that row=0
and C=0
specify
the first value in the file.
The following example creates a comma-separated value file from
the matrix m
.
m = [3 6 9 12 15; 5 10 15 20 25; ... 7 14 21 28 35; 11 22 33 44 55]; csvwrite('csvlist.dat',m) type csvlist.dat 3,6,9,12,15 5,10,15,20,25 7,14,21,28,35 11,22,33,44,55
The next example writes the matrix to the file, starting at
a column offset of 2
.
csvwrite('csvlist.dat',m,0,2) type csvlist.dat ,,3,6,9,12,15 ,,5,10,15,20,25 ,,7,14,21,28,35 ,,11,22,33,44,55
csvread
| dlmwrite
| uiimport
| writetable
| xlswrite