function [x n] = normcol(x)
%NORMCOL normalise the columns to unit length
%
% [x n] = normcol(x)
%
% normalises the columns of the input matrix x and returns a vector n
% containing the initial norm of the columns.

n = sqrt(sum(conj(x).*x,1));
x = x*diag(1./n);