how to extract a certain row out of a matrix

조회 수: 2 (최근 30일)
farfar
farfar 2018년 7월 19일
편집: jonas 2018년 7월 19일
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에서 Networks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by