Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
remove rows by specific numbers
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (1)
Andrei Bobrov
am 6 Feb. 2012
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 Kommentar
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!