find row in specifics value

2 vues (au cours des 30 derniers jours)
Fabyola
Fabyola le 24 Sep 2020
Modifié(e) : KSSV le 24 Sep 2020
if i want to find out my max_dk's variable result come out from what columns in variable 'hasildk' , what should i do next? thanks a lot for your help
hasildk = [0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1053; 0.2745 0.1443 0.0284 0.0000 0.1602 0.0000 0.0000; 0.5770 0.0054 0.0354 0.0000 0.0025 0.0002 0.0002; 0.0016 0.0077 0.0000 0.0000 0.0001 0.0000 0.0000; 0.3827 0.0117 0.0163 0.0000 0.0114 0.0000 0.0000; 0.3010 0.0068 0.0800 0.0001 0.0327 0.0024 0.0000; 0.0000 0.0000 0.0391 1.0000 0.0001 0.0000 0.0000; 0.0001 0.0013 0.1348 0.3578 0.0020 0.0000 0.0000; 0.0009 0.0002 0.2526 0.2581 0.0003 0.0000 0.0000; 0.0555 0.0119 1.0000 0.0391 0.0294 0.0000 0.0000]
[i,j] = size(10:1);
max_dk = zeros(i,j);
for k = 1:10
max_dk(k) = max(hasildk(k,:));
end
hasilmax = max_dk'

Réponse acceptée

KSSV
KSSV le 24 Sep 2020
Modifié(e) : KSSV le 24 Sep 2020
[val,idx] = max(hasildk,[],2)

Plus de réponses (0)

Catégories

En savoir plus sur Visual Exploration 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