       1.00          1.00          1.00
ans =
          3.00          4.00          5.00
</pre><p>If you need to operate across rows instead of down the columns of <tt>A</tt>, specify dimension 2 as follows:</p><pre class="codeinput">wmean(A,w,<span class="string">'dim'</span>,2)
</pre><pre class="codeoutput">ans =
          1.00
          3.00
          5.00
          7.00
</pre><p>If you're following along at home, you can prove to yourself that the answer above, in which all weights are equal, gives the 