Mercurial > hg > lots
diff support/normcol.m @ 6:e2a029a70df3
rearranged directories
author | danieleb@code.soundsoftware.ac.uk |
---|---|
date | Thu, 16 Jun 2011 13:43:16 +0100 |
parents | normcol.m@ee2a86d7ec07 |
children | 2e42f5fb764d |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/support/normcol.m Thu Jun 16 13:43:16 2011 +0100 @@ -0,0 +1,15 @@ +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. +% +% ----------------------------------------------------------- % +% Daniele Barchiesi, daniele.barchiesi@eecs.qmul.ac.uk % +% Centre for Digital Music, Queen Mary University of London % +% Apr. 2011 % +% ----------------------------------------------------------- % +n = sqrt(sum(conj(x).*x,1)); +x = x*diag(1./n); \ No newline at end of file