Mercurial > hg > lots
annotate normcol.m @ 3:ee2a86d7ec07
Added support functions
author | danieleb@code.soundsoftware.ac.uk |
---|---|
date | Wed, 15 Jun 2011 11:26:03 +0100 |
parents | |
children |
rev | line source |
---|---|
danieleb@3 | 1 function [x n] = normcol(x) |
danieleb@3 | 2 %NORMCOL normalise the columns to unit length |
danieleb@3 | 3 % |
danieleb@3 | 4 % [x n] = normcol(x) |
danieleb@3 | 5 % |
danieleb@3 | 6 % normalises the columns of the input matrix x and returns a vector n |
danieleb@3 | 7 % containing the initial norm of the columns. |
danieleb@3 | 8 % |
danieleb@3 | 9 % ----------------------------------------------------------- % |
danieleb@3 | 10 % Daniele Barchiesi, daniele.barchiesi@eecs.qmul.ac.uk % |
danieleb@3 | 11 % Centre for Digital Music, Queen Mary University of London % |
danieleb@3 | 12 % Apr. 2011 % |
danieleb@3 | 13 % ----------------------------------------------------------- % |
danieleb@3 | 14 n = sqrt(sum(conj(x).*x,1)); |
danieleb@3 | 15 x = x*diag(1./n); |