MATLAB: Weighted average for each row in a matrix

MATLABmatrixweighted_average

I have a 2×56 matrix of values, and I need to take the weighted average of every individual row and store it in a 1×56 matrix. One row weighs 1/3 and the other row weighs 2/3. How do I go about doing this without the use of another vector?

Best Answer

I need to take the weighted average of every individual column (?) and store it in a 1x56 matrix.
m=mean(M.*[1/3;2/3]);