Best way to work with large file (viewing and manipulating the data) - memory mapped temp files?
3 次查看(过去 30 天)
显示 更早的评论
Background
I routinely work with large files from different lab equipment setups - sizes can run from 50 MB to 1-2 GB. Analyzing this data requires both viewing it - looking through 5-10 parameters at once for a test period - and manipulating it - mathematical operations, combining parameters, etc. So far I've been doing this by loading the file into the workspace as a data array (up to a file size of 3-400 MB or so), and poking it/plotting it as needed.
My current project is to build a large GUI for scrolling through the parameters in my data files and occasionally doing operations to them while they're on the screen. For example, I might have 2000 parameters in a 1 GB file that my GUI plots 10 at a time. I can then combine two of them into one channel, take the derivative of another, etc etc.
To do this, my thought is to load the file (out of its custom file type) and immediate save it into a 'temporary' working file - probably a standard binary file type or a .mat file. Then I'd access it in a memory-map type fashion (either with the build in memory map or a custom logic type thing). I'll keep records of the operations performed, GUI settings, etc in the active workspace, but only dig into the 'real' data when I have to.
My question - does this sound like the right way to approach this? I'm worried about speed (how fast can I read/write out of the large memory mapped file?) and about running out of memory (workspace memory, not file space).
Any ideas?
Thanks! - J
2 个评论
Sven
2011-11-28
Do you have the latest MATLAB version? There was an enhancement to the load() function which allows you to load a certain subset of a file at one time. It might help you avoid too many temporary file issues... just save the whole data to a .mat file, then load pieces of the saved matrix on demand.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Adding custom doc 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!