why does "save -append" work so slow and increase the size of mat file for simple replacement?
7 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am in this situation for couple of times but have no clue. I can understand that when there are structures in my data, saving may take long time due to decompression. However, what confused me is that, even when I replace the existing structures only, without creating any new elements, the updated mat file increased a lot. It looks like the old structures are not erased at all. Could anyone help me out here? Thanks a lot.
0 件のコメント
回答 (2 件)
Benjamin Avants
2014 年 5 月 15 日
If you use the -append option, save will not overwrite any of your existing data. It will simply add the new data into the existing file. This can/will duplicate variables and structures already stored in the file.
If you want to change some of the values and not others, you should open the file and load the existing data. Then change the values you want to change in the imported data before overwriting the old file with the modified data. This is faster than appending an existing file and you don't get duplicate entries.
If you have the full data set in memory that you wish to save, simply overwrite the existing file with the data in memory. This would be the fastest way if it is possible in your code.
参考
カテゴリ
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!