How can I find the index of the maximum element in an array without looping?
For example, if I have:
a = [1 2 999 3];
I want to define a function indexMax
so that indexMax(a)
would return 3
.
Likewise for defining indexMin
.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…