How to delete a row from an array if a specified column has specified numbers?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
L'O.G.
el 30 de Mzo. de 2022
Comentada: L'O.G.
el 30 de Mzo. de 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 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!