turbofib
2018-10-19 23:49:58 UTC
a=[4 5 6 7;2 3 1 4;6 7 8 5;9 5 6 4]
i want to know index of max of each column between 1 and 3 rows..
2 3 4 4
6 7 8 5
9 5 6 4
max rows 1:3 is:
4 5 6==>6 =>index 3
2 3 1==>3 => index 2
6 7 8==>8=> index 3
9 5 6==>9==> index 1
answer is : 3 2 3 1
i try it :
[e,g]=find( a(1:3)==max(a(1:3,:)),3-1,"first")
but is not correct...i don't get the correct result
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
i want to know index of max of each column between 1 and 3 rows..
a
4 5 6 72 3 4 4
6 7 8 5
9 5 6 4
max rows 1:3 is:
4 5 6==>6 =>index 3
2 3 1==>3 => index 2
6 7 8==>8=> index 3
9 5 6==>9==> index 1
answer is : 3 2 3 1
i try it :
[e,g]=find( a(1:3)==max(a(1:3,:)),3-1,"first")
but is not correct...i don't get the correct result
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html