How do you get the row or column of something you need?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Shawn Simon
le 28 Nov 2015
Commenté : Shawn Simon
le 28 Nov 2015
For example, if you had:
abc
def
ghi
Say I wanted the row and column of 'e', how would I do this? I have been looking everywhere for this and I just can't seem to find it. Please help. Thank you!
0 commentaires
Réponse acceptée
Image Analyst
le 28 Nov 2015
[rows, columns] = find(yourMatrix == e); % e is an integer.
If e is not an integer or power of 2, see the FAQ : http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F
5 commentaires
Walter Roberson
le 28 Nov 2015
You decide which position is the "first" one, and you index rows() and columns() at that same index. But how do you define which is the "first" ?
AB
BD
which 'B' is 'first' ?
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!