Comparing 2 matrix with not the same dimension
Mostrar comentarios más antiguos
Lets say I have these 2 following matrix (which are not the same dimension):
A=[2 1 4 3 5 6] B=[5 4 3 1]
My goal is to find the following logical array:
A2=[1 0 0 0 0 1]
where 1 is the logical condition when a value in A is missing in B (again it must check the whole array B because dimension are not the same).
Thank you so much in advance for your answer !
Regards,
Pierre
Respuesta aceptada
Más respuestas (1)
Andrei Bobrov
el 28 de Oct. de 2017
all(A(:)' ~= B(:))
1 comentario
Pierre Lonfat
el 29 de Oct. de 2017
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!