function nd=ndata(data)

% NDATA       Normalise a data-set.
%
%             Example: load kddata;
%                      data=ndata(kea(:,1:2))
%
%             NDATA(DATA)
%
%             Christian C. Beardah 1996

[n,d]=size(data);
nd=(data-ones(n,1)*mean(data))*inv(sqrtm(cov(data)));