saving variables in a single .mat file
Ältere Kommentare anzeigen
Hello,
I have 360 .mat files containing same variable in with different data (row vectors) each of size in(1x3800000) stored in them. They are of size 9.84GB (all 360 files).
Now I want to save them all in 1 .mat file as a matrix out(360x3800000).
How can I do it?
Akzeptierte Antwort
Weitere Antworten (2)
Jan
am 26 Mär. 2012
0 Stimmen
Do you have a 64-bit Matlab version? How many RAM do you have installed? Do you want to store the values in one 360 x 3'800'000 array, a most likely more useful 3'800'000 x 360 array, of as separate vectors e.g. in a {1 x 360} cell. The later has the advantage, that it does not need a contiguos free block of memory.
4 Kommentare
zozo
am 26 Mär. 2012
Sivakumaran Chandrasekaran
am 26 Mär. 2012
Hi Jan,
I have a doubt in the mat file, which is present in image retrival project in file exchange of mathworks. It has 651 images in their database. The mat file has been splitted into two categories. files and Hists.. How to create two things in a mat file.
Regards,
siva
siva@sdatech.in
Jan
am 26 Mär. 2012
4GB RAM is very lean for such a big chunk of data. If it is really necessary to keep all values in the RAM simultaneously, buy more RAM. Implementing workarounds to process the data in pieces will be more expensive.
Jan
am 26 Mär. 2012
@Siva: Does you comment concern the current topic? If so, please explain the connection. If not, please delete the comment and post it as a new question - with more details. Thanks.
Daniel Shub
am 26 Mär. 2012
In a comment to Jan you say you have 4 GB of RAM. Loading 9+ GB of data is going to bring your computer to a screeching halt.
Try and create an array of the required size and see what happens ...
x = randn(360, 38000000);
2 Kommentare
zozo
am 26 Mär. 2012
Daniel Shub
am 27 Mär. 2012
Why? Nobody wants a 1+GB data file. Leave the files small and load them as needed. I doubt there is much of a benefit of doing a single huge load.
Kategorien
Mehr zu Workspace Variables and MAT Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!