function Correlation = cov_to_cor_one(Covariance)

% convert a set of covariance matrices into correlation matrices
s = size(Covariance,1);
d = size(Covariance{1},1);

Correlation = Covariance;

for j = 1:s
    for ii = 1:d
        for jj = 1:d
            if(ii == jj)
                Correlation{j}(ii,jj) = sqrt(Covariance{j}(ii,jj));
            else
                Correlation{j}(ii,jj) = Covariance{j}(ii,jj)/sqrt(Covariance{j}(ii,ii)*Covariance{j}(jj,jj));
            end
        end
    end
end


