matthiasm@8: N = 3; matthiasm@8: x = rand(N,2); % each row is a feature vector matthiasm@8: m = mean(x,1); matthiasm@8: xc = x-repmat(m, N, 1); matthiasm@8: matthiasm@8: C = eye(N) - (1/N)*ones(N,N); matthiasm@8: xc2 = C*x; matthiasm@8: assert(approxeq(xc, xc2))