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: pca.m
    path of file: ./repos/Machine-Learning-for-Solar-Energy-Prediction/Principal Components Analysis/PCA2
    
    the code of the file until where you have to start completion: %% Principal Component
    
function Z = pca(X,k)
    % Normalize the data
    mu = mean(X);   % mean of the data
    s = std(X,1);   % standard deviation of each coordinate
    X_norm = (X-mu)./s;

    % Compute the empirical covariance matrix of the data
    m = size(X,1);
    Sig = 1/m*(X_norm'*X_norm);

    % Compute the eigenvector of Sig
    [V,D] = eig(Sig);
    [~,I] = sort(diag(abs(D)),'descend