how to extract a certain row out of a matrix

Hello
How can I extract a certain rows out of a matrix ? for example:
a=[2 2;2 2;2 2;1 1;0 1;0 1;0 1]
I want to extract row [0 1] out a matrix a and have a new matrix b :
b=[0 1;0 1;0 1]
Thank you

 Akzeptierte Antwort

jonas
jonas am 19 Jul. 2018
Bearbeitet: jonas am 19 Jul. 2018

1 Stimme

ind=ismember(a,[0 1],'rows');
b=a(ind,:)

Weitere Antworten (0)

Tags

Gefragt:

am 19 Jul. 2018

Bearbeitet:

am 19 Jul. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by