How to Find a Value From Another Value?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a matrix, so I would like to find a value from the first column by using values from the last columns. For example, I have an specific value from the last column which I found by suing "find". How can I then find the value from the first column from that specific row by using the last column value?
0 commentaires
Réponse acceptée
Birdman
le 7 Déc 2017
One approach:
A=[1 2 3;4 5 6;7 8 9];
[r,c]=find(A==9);
value=A(r,1)
3 commentaires
Plus de réponses (1)
Andrei Bobrov
le 7 Déc 2017
Modifié(e) : Andrei Bobrov
le 7 Déc 2017
A = reshape(1:16,4,[]); % Let A - your array (example)
out = A(A(:,end) == 14,1)
Voir également
Catégories
En savoir plus sur Matrices and Arrays 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!