How do I export data to a file?

19 ビュー (過去 30 日間)
Daniel
Daniel 2025 年 4 月 21 日
コメント済み: Star Strider 2025 年 4 月 21 日
Hello,
I'm getting out of memory errors when trying to copy a large dataset (9003x9003 double) using Ctrl+C with the intention of pasting it to Excel, even though I've increased the Java Heap memory to the maximum. The error window suggests copying portions (I'm not doing that with such a large dataset) or exporting the dataset to a file - how do I do that please? I would expect such an option in its right-click menu but it's not there - i.e. let's make the paid software as complicated as we can :)))
xlswrite leaves me with empty files, csvwrite with corrupt files - even though it's plain data
Thank you

採用された回答

Star Strider
Star Strider 2025 年 4 月 21 日
If the data are in a matrix that are assigned to one or more variables, first use the save function to save t he variables to a .mat file. That will guarantee that you have a backup for it.
Second, use the writematrix (or writetable if it is already a table) functions to write it to a .txt of .xlsx file. You might be able to do that from the Command Wiindow. If not, you can load the .mat file and then write it.
  2 件のコメント
Daniel
Daniel 2025 年 4 月 21 日
編集済み: Daniel 2025 年 4 月 21 日
Thank you ^^
Why isn't there a simple Export button though? 🥺
Star Strider
Star Strider 2025 年 4 月 21 日
As always, my pleasure!
That there isn’t an Export button is a MathWorks design decision. I suggest that you Contact Support and suggest that option be added. I believe it would be useful.
Include the URL of this thread in your note to MathWorks so that you don’t have to repeat everything you wrote here.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by