You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: whiten.m
    path of file: ./repos/bspm/utilities
    
    the code of the file until where you have to start completion: function [Z,W,U,D] = whiten(X)

%[Z,W,U,D] = whiten(X);

    
function [Z,W,U,D] = whiten(X)

%[Z,W,U,D] = whiten(X);
%Whiten whitens ("spheres") X, returning decorrelated transform of X, Z, the sphering matrix, W, the matrix of eigenvactors 
%of covariance of X, U, and diagonal matrix, D. X is a matrix with the column index, j, corresponding
% to the jth measurment. Whiten returns as many principle components as Rank(X).

% ----------- SVN REVISION INFO ------------------
% $URL$
% $Revision$
% $Date$
% $Author$
% ------------------------------------------------

if nargin==0, mfile_showhelp; return; end