[matlab][solution] Find first position in 2-dimensional array

By.

min read

My profile

Share this:

Consider myo as a 2-dimensional array.

The maximum value is max(max(myo)); => k
max(myo) => will give an array like [0 5 6 0]

[code:1:f21d2c370e]k = (max(max(myo))); answer = find(max(myo) == k,1)[/code:1:f21d2c370e]

[b:f21d2c370e]myo [/b:f21d2c370e]=
[0 5 6 0
1 2 5 4]

[b:f21d2c370e]max(myo)[/b:f21d2c370e] = [b:f21d2c370e]k[/b:f21d2c370e]
6

[b:f21d2c370e]answer [/b:f21d2c370e]will be 3 ( 6 has position 3 in the array ).

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *