Removing certain rows from B using A as reference to produce C

조회 수: 1 (최근 30일)
JL
JL 2019년 9월 1일
댓글: JL 2019년 9월 1일
Hi everyone, I have A and B. I would like to use the values of A as reference to remove rows in B to get C
A =[11;
12;
14;];
B = [9 45996;
9 47540;
12 49047;
15 49151;
12 53151;
13 53239;
10 56044;
11 57046;
14 57279;
10 59286;
10 59889;];
Answer C
c = [12 49047;
12 53151;
11 57046;
14 57279;];

채택된 답변

madhan ravi
madhan ravi 2019년 9월 1일
c = B(ismember(B(:,1),A),:)

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