title: Julia: find maximum along columns in array
body: <p>Suppose we have an array defined like this:</p>
  
  <pre><code>a=[1 2; 3 4; 5 5; 7 9; 1 2];
  </code></pre>
  
  <p>In Matlab, we could find the maximum values by writing:</p>
  
  <pre><code> [x y] = max(a)
     x =
       7     9
  </code></pre>
  
  <p>In Julia, we could use:</p>
  
  <pre><code>  a=[1 2; 3 4; 5 5; 7 9; 1 2]
    findmax(a,1)
  </code></pre>
  
  <p>returning:</p>
  
  <pre><code> ([7 9],
  
    [4 9])
  </code></pre>
  
  <p>However, I am interested not only in finding [7 9] for the two columns, but also their relative position within each column, like [4, 4]. Of course, I can write a bit more of coding lines, but can I do it directly with findmax?</p>