exporting from cell to excel

1 view (last 30 days)
Wassim Dbouk
Wassim Dbouk on 20 Apr 2011
Edited: TED MOSBY on 18 Nov 2024
hi I have a 32000x24 cell array. Whenever I try to export it to excel (using xlswrite) or to csv (using cell2csv) it takes ages as matlab displays a busy signal. Any tip about how to export this file to excel?

Answers (1)

TED MOSBY
TED MOSBY on 16 Oct 2024
Edited: TED MOSBY on 18 Nov 2024
  • Usewritematrixorwritecell:If using a recent version of MATLAB (R2019a or later), try usingwritematrixorwritecellinstead ofxlswrite. These functions are generally faster and more efficient for writing data to files.
% Assuming your data is stored in a variable named 'data'
writecell(data, 'output.xlsx');
  • Split the Data:If possible, split your data into smaller chunks and write them individually.
  • Save as CSV:If Excel format is not a strict requirement, saving as a CSV file can be faster. You can usewritecellorwritematrixfor this purpose:
writecell(data, 'output.csv');
  • Increase MATLAB's Java Heap Memory:If you're running into memory issues, you might consider increasing the Java heap memory in MATLAB. You can do this by going toPreferences > MATLAB > General > Java Heap Memory.
  • Use Parallel Computing:If you have the Parallel Computing Toolbox, you could try to parallelize the export process. This might not be always faster.
Here is the documentation for writeCell and writeMatrix :
Hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!