how to extract a certain row out of a matrix

1 次查看(过去 30 天)
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

采纳的回答

jonas
jonas 2018-7-19
编辑:jonas 2018-7-19
ind=ismember(a,[0 1],'rows');
b=a(ind,:)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by