Effacer les filtres
Effacer les filtres

how to show index number of minimum value from matrices?

2 vues (au cours des 30 derniers jours)
FARAH HANIM AMIR
FARAH HANIM AMIR le 24 Avr 2017
i am doing a recognition system where i need to locate the minimum value for each row from the 40 by 40 matrices..i now can produce the list of minimum value from each row using this code.. A=min(euc,[], 2); but i still want it to show the minimum number produced is from which column (index number).. how do i write it?
best regards, farah

Réponse acceptée

KSSV
KSSV le 24 Avr 2017
K = rand(5) ;
[val,idx] = min(K,[],2) ;
r = [1:size(K,1)]' ;
% positions
[r idx]

Plus de réponses (1)

Adam
Adam le 24 Avr 2017
[A, idx] = min(euc,[], 2);
provides the index, as shown in the documentation
doc min

Catégories

En savoir plus sur NaNs 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!

Translated by