remove rows zeros( condition remove)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
i have a=
1 2 3 4 5
0 0 0 8 9
4 5 8 5 6
0 0 0 8 6
i need a=
1 2 3 4 5
4 5 8 5 6
i have to delete 2. and 4. rows who have zeros (not all rows zeros)in first three column(condition remove)
0 comentarios
Respuestas (2)
Jan
el 27 de Jun. de 2018
A = [1 2 3 4 5; ...
0 0 0 8 9; ...
4 5 8 5 6; ...
0 0 0 8 6] ;
index = any(A(:, 1:3), 2);
B = A(index, :)
0 comentarios
Ver también
Categorías
Más información sobre Data Types 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!