How can I select scattered rows from an array? Suppose
A = rand(6,6)
now how can I select everything except the second and fifth row of A?

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 26 de Abr. de 2020

0 votos

You can use setdiff()
A = rand(6,6);
idx = setdiff(1:size(A,1), [2 5]);
B = A(idx, :);

Más respuestas (0)

Categorías

Preguntada:

el 26 de Abr. de 2020

Respondida:

el 26 de Abr. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by