Comparison between two vectors and locate the error

I have to find the location of errors or differences between two vectors, for example
A=[ 5 2 -3 4 ]
B=[ -3 2 2 4 ]
the result should give locations of errors which are first and third number [1 , 3 ].
Thanks in advance

Respuestas (1)

Matt J
Matt J el 7 de Sept. de 2023
Editada: Matt J el 7 de Sept. de 2023
A=[ 5 2 -3 4 ];
B=[ -3 2 2 4 ];
locations = find(A~=B)
locations = 1×2
1 3

Categorías

Más información sobre Aerospace Blockset en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 7 de Sept. de 2023

Editada:

el 7 de Sept. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by