title: Matlab's nanmean( ) function not working with dimensions other than 1
body: <p>Take this example from the <a href="http://www.mathworks.com/help/toolbox/stats/nanmean.html" rel="nofollow">mathworks help</a> of <code>nanmean()</code>:</p>
  
  <pre><code> X = magic(3);
  X([1 6:9]) = repmat(NaN,1,5)
  
  X =
  
     NaN     1   NaN
       3     5   NaN
       4   NaN   NaN
  
  &gt;&gt; y = nanmean(X,2)
  ??? Error using ==&gt; nanmean
  Too many input arguments.
  </code></pre>
  
  <p>Why is it showing error even when the docs say the mean can be taken in any dimension <code>dim</code> of <code>X</code> as <code>y = nanmean(X,dim)</code>? Thanks.</p>