MATLAB Answers

find row in specifics value

22 views (last 30 days)
Fabyola
Fabyola on 24 Sep 2020 at 4:31
Edited: KSSV on 24 Sep 2020 at 4:42
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'

  0 Comments

Sign in to comment.

Accepted Answer

KSSV
KSSV on 24 Sep 2020 at 4:41
Edited: KSSV on 24 Sep 2020 at 4:42
[val,idx] = max(hasildk,[],2)

  0 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by