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

1 visualización (últimos 30 días)
JL
JL el 1 de Sept. de 2019
Comentada: JL el 1 de Sept. de 2019
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;];

Respuesta aceptada

madhan ravi
madhan ravi el 1 de Sept. de 2019
c = B(ismember(B(:,1),A),:)

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by