Save results to disk in a loop/RAM Memory problem
Mostrar comentarios más antiguos
Hello,
I am having problems with the limit of RAM memory. In my application, I have a loop like the following:
%% 1. Data obtaining
n_loops=1000;
all_results = zeros(dim1, dim2, n_loops)
for i=1:n_loops
%result_of_one_loop = get_result_command;
all_results(:,:,i) = result_of_one_loop;
end
%% 2. Post-processing
%Post-procesing code here.
This code runs out the RAM. Is there any option to solve this problem? Maybe saving into the disk memory the results file, increasing the size in each loop (but not overwriting)? Thank you so much for your help.
2 comentarios
Jan
el 26 de En. de 2023
This piece of code is too simplified, to explain the source of the problem. If the pre-allocation zeros(dim1, dim2, n_loops) is working successfully, filling the memory is no reason for further allocations.
Please postr some code, which reproduces the problm and pos a copy opf the complete error message. This will show us, which line is failing.
JORGE REVUELTA LOSADA
el 3 de Feb. de 2023
Respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements 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!