function StdData = stdizedata(Data)
% usage: StdData = stdizedata(Data)
% description: returns standardized data
% generated from input dataset Data. Note:
% It is assumed that Data does not
% generate singular covariance matrix.

% programmer: t. shores         last rev.: 8/10/07

[n,p] = size(Data);
s = sqrt(diag(cov(Data)))';
mu = mean(Data);
StdData = (Data - mu(ones(n,1),:))./s(ones(n,1),:);


