annotate general/numerical/divnorm.m @ 4:e44f49929e56
Adding reorganised general toolbox, now in several subdirectories.
author |
samer |
date |
Sat, 12 Jan 2013 19:21:22 +0000 |
parents |
|
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
|