Writing and Reading Spreadsheet Files:
The MATLAB functions xlswrite & xlsread will write to and read from the spreadsheet files which have the extension .xls. For illustration, the below will generate a 5 × 3 matrix of arbitrary integers, and then write it to a spreadsheet file known as the 'ranexcel.xls' which has five rows and three columns:
>> ranmat = randint(5,3,[1 100])
ranmat =
96 77 62
24 46 80
61 2 93
49 83 74
90 45 18
>> xlswrite('ranexcel',ranmat)