I was wondering if the latest version of Matlab R2011a has any built in functionality, or if there's anything recent on the file exchange, that can load in only part of a vector, matrix or cell array stored in a ".mat" file.
For example if I have a file "output.mat" which contains a single variable "large_matrix" which is a (100x100) matrix is there a way I can load say the 10th element, large_matrix(10), without loading the entire matrix into memory?
The above is to just illustrate my question I know Matlab could easily load a 100x100 matrix into memory.
The most Matlab seems to offer is selectively loading variables e.g.
loaded_file = load('output','other_variable'); other_variable = loaded_file.other_variable;
But I'm hoping I'm wrong.
Any advice would be greatly appreciated, Thanks
No products are associated with this question.
Loading parts of arrays from .mat files have been discussed in the forum before:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/11819 http://www.mathworks.com/matlabcentral/newsreader/view_thread/124558 http://www.mathworks.com/matlabcentral/newsreader/view_thread/171729 http://www.mathworks.com/matlabcentral/newsreader/view_thread/261264 http://www.mathworks.com/matlabcentral/newsreader/view_thread/277386 http://www.mathworks.com/matlabcentral/newsreader/view_thread/288926 http://www.mathworks.com/matlabcentral/newsreader/view_thread/301858
When I did an official feature request some years ago ( making-a-feature-request ) I got the answer that not enough users are requesting this feature. So if you like to have it, you should consider writing to MathWorks.
Best regards, Bjoern
unfortunately the answer is no (for R2011a). What I have done is to write a simple function that splits the variable into pieces when saving to a file, and read the pieces afterwards while processing the data...
The feature seems to be added in Matlab R2011b by a new function called matfile. I will try this out the next days. MathWorks, this looks like an important improvement. Thank you for listening to your customers.