Accessing elements of a large cell array inside a MAT file?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a huge (~25gb) cell saved in a 7.3 format MAT file, and I want to access just a few entries from it. I tried to write some code to pull out only the data I need, initially using the matfile command to access the data I need;
inputdata = matfile('fullsetrc150.mat');
data_acquired = inputdata.Segframe{1,401}{1,3};
However as I understand it, matfile cannot handle cell operations, so I am stuck with a massively time and memory consuming script like this instead;
inputdata = matfile('fullsetrc150.mat');
chunk = inputdata.Segframe;
data_acquired = chunk{1,401}{1,3};
clear chunk;
This can take literally hours to run and is incredibly inefficient; is there a more clever way to access just the data I need, or must I load the entire cell to pull values from it? Any advice is welcome!
0 Commenti
Risposte (2)
Guillaume
il 7 Nov 2014
Unfortunately, matfile is the only interface that matlab provides to read parts of a mat file. And as the documentation says, it cannot read just part of a cell array.
I would look on the file exchange to see if somebody has a partial loader for cell arrays. Otherwise, I'm afraid you would have to write your own parser, either as a matlab function or a mex file (for performance) based on mathworks' description of the mat file format.
0 Commenti
Stalin Samuel
il 7 Nov 2014
first load the .mat file.then you will have all the variables in your workspace.Now you can directly access the variables
Vedere anche
Categorie
Scopri di più su Workspace Variables and MAT-Files in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!