Two vectors different from each other at least at two points
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to compare two vectors and check whether they are different at least at two coordinates.
0 Kommentare
Akzeptierte Antwort
jonas
am 6 Okt. 2018
Bearbeitet: jonas
am 6 Okt. 2018
sum(abs(V1-V2)~=0)>=2
Will output 1 if they differ at two or more indices. You may want to set a tolerance if they are floating point numbers.
tol=0.01
sum(abs(V1-V2)>tol)>=2
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!