How to delete a row from an array if a specified column has specified numbers?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
L'O.G.
am 30 Mär. 2022
Kommentiert: L'O.G.
am 30 Mär. 2022
I want to delete a row from an array if a specified column has a specified number. How do I generalize the following if there is more than one number specified, i.e., for a vector with arbitrary length? The following does what I want for the specified numbers 5 and 6 and column 2, but I want to generalize it.
A(((A(:,2) == 5) | (A(:,2) == 6)),:) = [];
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!