eighting:</p><pre class="codeinput">y = 0:2:10
mean(y)
</pre><pre class="codeoutput">y =
  Columns 1 through 5
             0          2.00          4.00          6.00          8.00
  Column 6
         10.00
ans =
          5.00
</pre><p>The answer above is equivalent to using <tt>wmean</tt> with equal weights for each value in <tt>y</tt>:</p><pre class="codeinput">weight = [1 1 1 1 1 1];

wmean(y,weight)
</pre><pre class="codeoutput">ans =
          5.00
</pre><p>But perhaps you're doing a calculation in w