MATLAB: Him I have a 9 * 9 matrix and I want to reduce each row in the column, the average of that column. How to do this

matrix helpmatrix manipulation

I have a 9 * 9 matrix and I want to reduce each row in the column, to the average of that column. How do I do this? For example
a=[3 2 3;1 2 3; 2 2 3]
b=mean(a)=[2 2 3]
a-b=[1 0 1; -1 0 1;0 0 1]
(I want the matrix after reduce the mean)

Best Answer

Try this:
a=[3 2 3;1 2 3; 2 2 3]
b = repmat(mean(a), [size(a, 1), 1])
aMinusB = a-b
You get
a =
3 2 3
1 2 3
2 2 3
b =
2 2 3
2 2 3
2 2 3
aMinusB =
1 0 0
-1 0 0
0 0 0
I really don't know how you're getting your a-b. Maybe you can explain.