Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function
Write comma-separated value file
write_csv(M, filename [,sep, dec])
a character string. The file path.
a matrix of strings.
column separator mark, by default a tabulation: ascii(9) or "\t".
decimal mark '.' or ',' by default a ','
write_csv(M, filename) writes matrix M into filename as comma-separated values. The filename input is a string.
if the file 'filename' already exists, it is overwritten.
// save a matrix as csv file format A = [1:10] * 0.1; write_csv(A, TMPDIR + '/datas.csv'); // read as text mgetl(TMPDIR + '/datas.csv') r = read_csv(TMPDIR + '/datas.csv',ascii(9)); r = strsubst(r,',','.'); evstr(r) A = [1:10] * 0.1; write_csv(A', TMPDIR+'/foo.csv', ' ', '.'); mgetl(TMPDIR+'/foo.csv')
- Allan CORNET