find largest magnitude in array
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A=[-0.1;1;-5;-0.8;-0.4];
tto=find(A == max(abs(A)))
tt=find(A ~= max(abs(A)))
I want to find index of largest magnitude in array and put it in 'tto'.
And put rest indices in tt
result should be
tto=3
tt=[1;2;4;5]
0 commentaires
Réponse acceptée
gonzalo Mier
le 9 Mai 2019
Modifié(e) : gonzalo Mier
le 9 Mai 2019
A=[-0.1;1;-5;-0.8;-0.4];
tto=find(abs(A) == max(abs(A)))
tt=find(abs(A) ~= max(abs(A)))
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Fixed-Point Matrix Operations in MATLAB 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!