How do I export data to a file?

20 次查看(过去 30 天)
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 个)

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by