exporting from cell to excel

1 回表示 (過去 30 日間)
Wassim Dbouk
Wassim Dbouk 2011 年 4 月 20 日
編集済み: TED MOSBY 2024 年 11 月 18 日
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?

回答 (1 件)

TED MOSBY
TED MOSBY 2024 年 10 月 16 日
編集済み: TED MOSBY 2024 年 11 月 18 日
  • 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!

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by