Info

This question is closed. Reopen it to edit or answer.

How to extract some rows from a matrix which crosspond to some value in another vector?

1 view (last 30 days)
I have a matrix
D= [ 1 11 1 1; 1 2 3 4; 5 6 7 8]; V=[3 2 2];
How to extract all the rows which crossponds to v=2 ?

Answers (1)

Cris LaPierre
Cris LaPierre on 18 Feb 2020
D(V==2,:)

This question is closed.

Community Treasure Hunt

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

Start Hunting!