- You can pcik the rows you want of 0 and 1 using logical indexing.
- Once you seperate two matrices, use pdist2. This will give you pair wise distances. Read about it.
- Once distance is obtained, you can check for your conditions.
How to determine the distance between a group of XY pairs against other XY pairs within a matrix?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have this mega matrix (1000:4) with observations that has 0 and 1 on the last column.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/407805/image.png)
The second and third column contains the observations' x,y coordinates in m distance. I want to create a condition where it can output the rows that include 0, satisfy the condition that the measured distance between an observation of 0 and 1 that were less than 5m and then count the no. of observations that satisfied both conditions.
How could I list them out? I realise that the essential functions that I can use could be for loop and count. Or maybe I am over complicating?
Thanks!
0 commentaires
Réponse acceptée
KSSV
le 9 Nov 2020
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!