Delete rows in a given array based on values in another array
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Turbulence Analysis
am 10 Apr. 2024
Kommentiert: Star Strider
am 10 Apr. 2024
Hi,
I have two arrays A (179528104x1) and B (1x9700). Here, in the array A, I need to retain only the rows that contain values present in the array B and delete all other rows.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 10 Apr. 2024
Perhaps this —
A = randi(99, 50, 1);
Abfr = buffer(A,10) % Show Everything In 'A'
B = randi(99, 10, 1)
[ix,v] = ismember(A, B);
C = A(ix)
.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!