ss="comment">% A data matrix:</span>
A = [0 1 2
     2 3 4
     4 5 6
     6 7 8]

<span class="comment">% Equal weights everywhere:</span>
w = ones(size(A))

wmean(A,w)
</pre><pre class="codeoutput">A =
             0          1.00          2.00
          2.00          3.00          4.00
          4.00          5.00          6.00
          6.00          7.00          8.00
w =
          1.00          1.00          1.00
          1.00          1.00          1.00
          1.00          1.00          1.00
   