remove row in A by referencing on another matrix, B, with true or false to produce another matrix c

조회 수: 1 (최근 30일)
Hi everyone, I want to reduce remove rows in matrix A, by referencing on matrix B to produce C. In this case, if its TRUE, remove the row
A = [1 1 1 0
0 1 1 1
0 1 1 0
1 0 1 0];
B =[True
False
False
True]
Results C =
C = [0 1 1 1
0 1 1 0];

채택된 답변

madhan ravi
madhan ravi 2019년 9월 9일
Use the same approach shown in your previous questions!
C = A(B==false,:)
  댓글 수: 4

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by