I was wondering if there was a way to directly write a spreadsheets in Matlab, or if someone had published a Matlab add-on that specifically introduced spreadsheets?


I recommend you to use the .csv format in order to export MATLAB data to a spreadsheet. You can write a matrix to a csv file using the the csvwrite function. The following code writes matrix M to a csv file in your workspace:


You can easily import the csv file to excel, numbers, google docs etc.


If you want to write an Excel spreadsheet, you can do so directly with the xlswrite function.


filename = "spreadsheet.xlsx";
data = 1:5;
xlswrite(filename,data);   % Writes matrix 'data' to the sheet starting at cell A1.

The variable viewing window gives some spreadsheet functionality (e.g. paste from excel).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.