How to write data from Matlab to Excel (especially when you don't have Excel)

If you are using Matlab on a MS-Windows PC with MS-Excel installed, there is no problem reading and writing data to Excel (in case your users/customers only understand this software but you still want to do the computations in Matlab). Here is the code to read (1st line) and write (2nd line): [sourcecode language=“matlab”] inputs = xlsread(‘inputfile.xls’, ‘inData’, ‘A1:B3’); [writeStatus, writeMsg] = xlswrite(‘outputfile.xls’, myMatrix, ‘outData’, ‘A1’); [/sourcecode] Now, there are several reasons why you may not be able to read and write directly to an Excel file: you have Matlab but ...

December 11, 2012 · 3 min · jepoirrier