[TOC]

csvwrite

Write an array to a CSV file

Usages

csvwrite(path, A)

csvwrite(path, A, r, c)

Examples

Input
path = './../csv/data/a.csv';
a = complex([1 2 3;4 5 6;7 8 9],[1 2 3;4 5 6;7 8 9])
csvwrite(path,a);
b = csvread(path)
Output
a =
 1.000 + 1.000i   2.000 + 2.000i   3.000 + 3.000i
 4.000 + 4.000i   5.000 + 5.000i   6.000 + 6.000i
 7.000 + 7.000i   8.000 + 8.000i   9.000 + 9.000i

Array written to debug/csv/data/a.csv successfully.

Array read from debug/csv/data/a.csv successfully.

b =
 1.000 + 1.000i   2.000 + 2.000i   3.000 + 3.000i
 4.000 + 4.000i   5.000 + 5.000i   6.000 + 6.000i
 7.000 + 7.000i   8.000 + 8.000i   9.000 + 9.000i
Input
path = './../csv/data/a.csv';
a = [1 2 3;4 5 6;7 8 9]
csvwrite(path,a,1,2);
b=csvread(path)
Output
a =
 1.000   2.000   3.000
 4.000   5.000   6.000
 7.000   8.000   9.000

Array written to debug/csv/data/a.csv successfully.

Array read from debug/csv/data/a.csv successfully.

b =
 0.000   0.000   0.000   0.000   0.000
 0.000   0.000   1.000   2.000   3.000
 0.000   0.000   4.000   5.000   6.000
 0.000   0.000   7.000   8.000   9.000