MATLAB: How to find the raw mean value of matrix

MATLABmatricesmatrix

if I have this matrix:
x=[1 2 3 4;5 6 7 8 9;10 11 13 14;];
How can I find the mean value in each raw since the mean value finds the mean value of each column?
and how could I find in which column the maximum value of the entire matrix? (which is one number)

Best Answer

mean() also accepts the dimension in which you want to operate
x = [1 2 3 4; 5 6 7 8;10 11 13 14;];
row_mean = mean(x, 2);
[~, idx] = max(x, [], 'all', 'linear');
[~, max_col] = ind2sub(size(x), idx)