Mercurial > hg > ishara
annotate general/numerical/divnorm.m @ 19:1eb0ea29ec40
Doesn't belong here.
author | samer |
---|---|
date | Thu, 17 Jan 2013 13:32:19 +0000 |
parents | e44f49929e56 |
children |
rev | line source |
---|---|
samer@4 | 1 function [Y,Z]=divnorm(F,X) |
samer@4 | 2 % divnorm - Do divisive normalisation of a sequence of vectors. |
samer@4 | 3 % |
samer@4 | 4 % divnorm :: |
samer@4 | 5 % ([[N,L]] -> [[1,L]]) ~'function to compute norm', |
samer@4 | 6 % [[N,L]] ~'array of L N-dim vectors' |
samer@4 | 7 % -> [[N,L]] ~'normalised vectors (ie unit 2-norm)', |
samer@4 | 8 % [[1,L]] ~'array of normalisation factors'. |
samer@4 | 9 % |
samer@4 | 10 % ie, if [Y,Z]=divnorm(X), |
samer@4 | 11 % then X = repmat(Z,size(X,1),1).*Y |
samer@4 | 12 % |
samer@4 | 13 % TODO: might like to smooth the envelope before dividing. |
samer@4 | 14 Y = vecop1(@rdivide,X,F(X)); |
samer@4 | 15 |