필터 지우기
필터 지우기

call certain rows to form a list

조회 수: 1 (최근 30일)
JL
JL 2019년 8월 2일
댓글: JL 2019년 8월 2일
Hi I have data below:
1 1 1 1 1
0 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 0 1 1 1
1 1 1 1 1
I want to call only those with 0s, meaning in my new list I have
0 1 1 1 1
1 0 1 1 1

채택된 답변

Walter Roberson
Walter Roberson 2019년 8월 2일
mask = ~all(YourArray,2);
subset = YourArray(mask,:);
  댓글 수: 2
JL
JL 2019년 8월 2일
Thank you very much Walter! I have another question, I was wondering if you could assist? - here is the link https://uk.mathworks.com/matlabcentral/answers/474657-assign-values-for-the-list-of-numbers-in-the-column-from-a-look-up-lable
JL
JL 2019년 8월 2일
Hi Walter, just a quick query as a follow up to this question if I have matrix
ans =
0 1 1 1 1
0 1 1 0 1
1 1 1 0 1
1 1 1 0 1
0 1 1 1 1
and I just wanted to select the unique ones, means
ans =
0 1 1 1 1
0 1 1 0 1
1 1 1 0 1

댓글을 달려면 로그인하십시오.

추가 답변 (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