Save a matrix to a file with an array of matrices without loading all of the data
2 次查看(过去 30 天)
显示 更早的评论
I have the (example) matrix rand(1000,1000) generated in a loop. For each loop I want the data in this matrix to be saved to a file to be accessed later. For example (unless there is a better way), after each loop the number of rows in the full matrix increases from 1000 to 2000, 3000, etc.
The goal is to save the matrices to the hard drive, freeing up memory. I need to be able to write to the file without reading the whole thing into memory. The data can also later be accessed to generate animated figures of the data without taking up processing power in between loops.
Can this be done with save()? What other approaches are there?
0 个评论
回答(1 个)
Jeremy Wurbs
2013-11-28
I believe the functionality you are looking for can be done with a matfile object (refer to ' help matfile '), but unfortunately I have not used them enough to know what memory issues you might still run in to.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!