%% Write Matrix to Comma-Separated Value File
% Create an array of sample data M.

M = magic(3)

% Write matrix M to the file 'myFile.txt'.

csvwrite('myFile.txt',M)

% View the data in the file.

type('myFile.txt')

% Copyright 2018 The MathWorks, Inc.