How to find (x,y) from a matrix of Nx2?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
X=[5 6 9 8 4];
Y=[8 7 2 1 9];
L=[X' Y'];
Now i need to find (6,7) in that L matrix. If its not there then print 0 but if it is there print 1?
2 Kommentare
Image Analyst
am 21 Mär. 2021
Are they definitely pure integers? Otherwise (floating point/fractions) use ismembertol() or simply compute the distances with pdist2() or sqrt() and pick the row with the least distance that's > 0.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!