Reducing a very long vector
Mostrar comentarios más antiguos
I would like to reduce a very long vector without using any (significant amount of) additional memory. For instance, suppose I have slightly over 6GB available and use 6GB of it for a vector A of size [2*N,1]. After some calculations I would like to keep only the first N entries of A. I tried
A = A(1:N, 1);
but it appears that for a short period I will need additional 3GB (which I do not have) as if the first half of A is copied somewhere else and then back. I am looking for a way to move the end-of-array pointer of A to the middle of A and release the second half of A.
Thank you, Borislav
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Performance and Memory en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!