Dear all: I have a 5*2 matrix. i want to find out the row and column of a special value.let A=[1 2;4 5; 1 8;2 6;9 7] I want to find the row and column of 9 and 7.how can i do this?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
fariba amini
le 21 Juin 2016
Réponse apportée : Thorsten
le 21 Juin 2016
Dear all: I have a 5*2 matrix. I want to find out the row and column of a special value.let A=[1 2;4 5; 1 8;2 6;9 7] I want to find the row and column of 9 and 7 toghether.how can i do this?
0 commentaires
Réponse acceptée
Thorsten
le 21 Juin 2016
If your matrix has the same number of columns as your vector, as in your example, you just have to find the row:
r = find(ismember(A, [9 7], 'rows'))
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps 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!