How to find a spesific value in a matrix?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ararat Cetinkaya
le 20 Mai 2020
Modifié(e) : Ameer Hamza
le 20 Mai 2020
I have an obstacles = [3,3; 3,4; 3,5; 4,3] matrix and I want to search [3,3] matrix in obstacles matrix and if this coordinates matches ı want to get 1 otherwise ı want to get 0 value.
0 commentaires
Réponse acceptée
Ameer Hamza
le 20 Mai 2020
Modifié(e) : Ameer Hamza
le 20 Mai 2020
obstacles = [3,3; 3,4; 3,5; 4,3];
TF = ismember([3 3], obstacles, 'rows')
Result
>> TF
TF =
logical
1
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!