difficulty filter file with big data

26 visualizaciones (últimos 30 días)
AIRTON
AIRTON el 21 de Sept. de 2025 a las 21:33
Comentada: Walter Roberson el 22 de Sept. de 2025 a las 1:29
I need of help me with this script. I want to filter all the columns but this is very slow.
there I have filtered only two columns.
My file loaded is only example.
clear all
clc
tic
a = 1;
r = zeros(3268760,1);
load ('filter_big_data'); % this file ís a matrix 576x3268760 double
for i = 1:2
z1 = b(b(:,1) == 0, :);
s1 = sum(z1, 1);
s2 = max(s1);
r(a,1) = max(s1);
a = a + 1;
end
toc
Elapsed time is 209.340817 seconds. % this time was elapsed for to filter two columns of
Thank by attention!!!
  3 comentarios
AIRTON
AIRTON el 21 de Sept. de 2025 a las 23:06
Hy Walter
you have reason!
I have changed my script.
Can you help me, I am inexperient with Matlab. I am learning.
Thanks!
Walter Roberson
Walter Roberson el 22 de Sept. de 2025 a las 1:29
z1 = b(b(:,1) == 0, :);
That code does not depend on a or i so it is going to produce the same result for every iteration of the loop. Because of that, every iteration of the loop is going to perform the same operation.
I would suggest that the code should be closer to
tic
r = zeros(3268760,1);
load ('filter_big_data'); % this file ís a matrix 576x3268760 double
for i = 1:2
z1 = b(b(:,i) == 0, :);
s1 = sum(z1, 1);
s2 = max(s1);
r(i,1) = max(s1);
end
toc

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by