function [XR,xM]=center(X)
% format function [XR,xM]=center(X) or XR=center(X)
% centers each element of matrix X by the column mean.
% optional output, the centering row vector, XM
[R,C]=size(X);
xM=mean(X);
XR=X-xM(ones(R,1),:);