How to export any size matrix like
A=
1 2 3 4 5 6 ....9
3 6 7 8 9 9 ....4
...
6 7 7 4 4 5 ... 2
To a file that will contain that matrix where each value is separated by ',':
1, 2, 3, 4, 5, 6, ....,9
3, 6, 7, 8, 9, 9, ...开发者_如何学运维.,4
...
6, 7, 7, 4, 4, 5, ... ,2
Use DLMWRITE. Doing this:
>> A = [1 2 3 4; 5 6 7 8]; >> dlmwrite('file.csv', A);
writes a file with this:
1,2,3,4 5,6,7,8
精彩评论