How can I avoid the "out of memory' for the following code?
Mostrar comentarios más antiguos
I have one set of data that has multiple matrices of 40000x10800. I want to extract those matrices column by column, clear it from zeros values, and the save them in another matrix. but when I ran the following code, it gives the "out of memory" message. Please help me.
r=randi([0 10],40000,10800);
for i=1:1:10800
r_0=r(:,i);
r_0=r_0(r_0~=0);
r_1(:,i)=r_0;
end
I have adjusted the code like above because my dataset is more the 5 Gb, so I couldn't attach it.
6 comentarios
Image Analyst
el 11 de Sept. de 2022
You forgot to attach the .mat files! We'll check back later for them.
If you have any more questions, then attach your data files with the paperclip icon after you read this:
Ranu Ghafour
el 11 de Sept. de 2022
Image Analyst
el 11 de Sept. de 2022
Then at least give us code to create the variables, even if you just fill them with random numbers.
Come on, make it EASY for us to help you, not hard.
Ranu Ghafour
el 12 de Sept. de 2022
Editada: Ranu Ghafour
el 13 de Sept. de 2022
David Hill
el 13 de Sept. de 2022
You cannot have a matrix with different number of rows or columns. What you are trying to do will not work. What are you really trying to do? What is the big picture?
Ranu Ghafour
el 13 de Sept. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical 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!

