Using the find function
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A= magic(4)
for z= 1:4
position(z) = find(A(:,z)>10,1)
end
I want to use the find function to find all the values greater than 10 . this will enable me use the command A(position) to get all the values greater than 10 in a matrix. Is this possible with matlab?
0 commentaires
Réponse acceptée
Thomas
le 20 Avr 2012
A= magic(4)
[row,col]=find(A>10)
should give you all positions of values in a Which are > 10
To find the actual values in A which are > 10 use
A(A>10)
ans =
16.00
11.00
14.00
15.00
13.00
12.00
0 commentaires
Plus de réponses (1)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!