omit rows from matrix
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
NA
el 24 de Nov. de 2018
Editada: madhan ravi
el 24 de Nov. de 2018
A=[1,2;1,3;1,4;1,5;2,4;2,3;2,5]
B=[2,4]
I want to omit B from matrix A
answer
A=[1,2;1,3;1,4;1,5;2,3;2,5]
0 comentarios
Respuesta aceptada
madhan ravi
el 24 de Nov. de 2018
Editada: madhan ravi
el 24 de Nov. de 2018
>> A=[1,2;1,3;1,4;1,5;2,4;2,3;2,5];
B=[2,4];
idx=ismember(A,B,'rows');
A = A(~idx,:)
A =
1 2
1 3
1 4
1 5
2 3
2 5
>>
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices 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!