How can I minimise the memory usage of the cat function
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have two very large data sets that I would like to concatenate using the CAT function. For example
A = rand(10000,10000);
B = rand(10000,10000);
C = cat(3,A,B);
Clear A B
My issue is around memory, the code above requires double the memory. Does anyone know a way that I can concatenate without using more memory? My inclination is to look at copy on write, and handle classes, but it is not clear to me if this would work? Thanks!
0 Commenti
Risposte (2)
Iain
il 21 Mag 2013
Why not just create C to start with?
C = rand(10000,10000,2); ?
NB, C requires 1.4Gb of RAM. I suggest you avoid such big variables unless you have good reason.
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices 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!