Check it out:
>> A = zeros(3);>> A(2,3) = 1 A = 0 0 0 0 0 1 0 0 0>> tmp = A'tmp = 0 0 0 0 0 0 0 1 0>> [maxVal, maxInd] = max(tmp(:)) maxVal = 1maxInd = 6
And now the WTF comes:
>> ind2sub(size(tmp), maxInd)ans = 6>> ind2sub(maxInd, size(tmp))ans = 3 3
Seems like function is dead.
Best Answer