title: Index of max and min value in an array
body: <p>How can I find the index of the maximum element in an array without looping?</p>
  
  <p>For example, if I have:</p>
  
  <pre><code>a = [1 2 999 3];
  </code></pre>
  
  <p>I want to define a function <code>indexMax</code> so that <code>indexMax(a)</code> would return <code>3</code>.</p>
  
  <p>Likewise for defining <code>indexMin</code>.</p>