>> a = [2,3,4;6,7,8]
a =
2 3 4
6 7 8
>> mean(a)
ans =
4 5 6
where [4 5 6]
is the mean for each column
How can I get the mean for each row?
In my example, I would expect [3;7]
From http://www.mathworks.co.uk/help/techdoc/ref/mean.html:
For matrices,
mean(A,2)
is a column vector containing the mean value of each row.
In Octave it's the same.