Loading and unloading data files
古いコメントを表示
In the applications I'm working on I typically store information in .mat files which I then load several times throughout the application. I don't like passing this data through global variables so I end up loading the data several times. My question is does this data get saved into memory each time? Or does each load remove the previous version in memory? Additionally, do I need to close the file somehow?
Thanks, Jeff
採用された回答
その他の回答 (1 件)
per isakson
2013 年 5 月 31 日
0 投票
"does this data get saved into memory each time". I'm not sure I understand correctly. The system cache is affected and data are written to disk.
"Or does each load remove the previous version in memory?". The values of the Matlab variables are replaced each time. If the data are still in system cache that is used otherwise data are read from disk.
No, you don't need (and cannot) close the file explicitly.
Are you aware save( .... , '-v6' ) is faster?
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!