From: Li on 25 Mar 2010 16:29 I am working on a set of data with millions of rows. So I have to find the fastest way to process it. Now I just want to remove the rows, if the vector (the first column) in that row is equal to zero. I used the below code, and it took almost an hour to finish. Is there a quicker way to do this? Thanks! Ind = []; for i = 1:m; if A(i, 1) == 0 ; Ind = [Ind; i]; end; end; A (Ind, :) = [];
From: XYZ on 25 Mar 2010 16:34 On 25.03.2010 21:29, Li wrote: > I am working on a set of data with millions of rows. So I have to find > the fastest way to process it. Now I just want to remove the rows, if > the vector (the first column) in that row is equal to zero. I used the > below code, and it took almost an hour to finish. Is there a quicker way > to do this? Thanks! > > Ind = []; > for i = 1:m; if A(i, 1) == 0 ; > Ind = [Ind; i]; > end; > end; > A (Ind, :) = []; A = A(find(A(:,1)),:)
|
Pages: 1 Prev: pop up menu callback error Next: Remove a row if the vector in that row is 0 |