%% Write Matrix to Spreadsheet File
% Create a matrix, write it to a spreadsheet file, and then read and display the contents of the file.
% Create a matrix in the workspace.

M = magic(5)

% Write the matrix to a spreadsheet file.

writematrix(M,'M.xls')

% Read and display the matrix from M.xls.

readmatrix('M.xls')

% Copyright 2018 The MathWorks, Inc.