remove rows by specific numbers

I want to remove entire rows if one columns has a range of values. With loops I am running out of memory so maybe some other solution would be great (columns 1 is time columns 2 and 3 are units ) the dataset has millions of rows
90000 10 6 90001 14 8 90002 8 5 90003 11 4 90004 15 9 90005 13 4 90000 1 1.5 90001 3 2.5 90002 14 8 90003 7 4 90004 7 9
if I want to remove a range of time stamps , for simplicity say 2 of them 90001 and 90002 what is a possible solution that I can run on a normal laptop without memory issues to get an output like
90002 8 5 90003 11 4 90004 15 9 90005 13 4 90002 14 8 90003 7 4 90004 7 9
thanks

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2012년 2월 6일

0 개 추천

data = reshape([90000 10 6 90001 14 8 90002 8 5 90003 11 4 90004 15 9 90005 13 4 90000 1 1.5 90001 3 2.5 90002 14 8 90003 7 4 90004 7 9],3,[])'
%solution
out = data(~ismember(data(:,1),[90000,90001]),:)

댓글 수: 1

Tiina
Tiina 2012년 2월 6일
thanks works well

이 질문은 마감되었습니다.

태그

질문:

2012년 2월 6일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by