Mercurial > hg > ishara
annotate general/numerical/addnorm.m @ 35:f1ce7876346a
Updated docs.
author | samer |
---|---|
date | Mon, 21 Jan 2013 11:01:45 +0000 |
parents | e44f49929e56 |
children |
rev | line source |
---|---|
samer@4 | 1 function [Y,M]=addnorm(F,X) |
samer@4 | 2 % addnorm - additive normalisation with respect to arbitrary function |
samer@4 | 3 % |
samer@4 | 4 % addnorm :: |
samer@4 | 5 % ([[N,M]] -> [[N,1]]) | ([[N,M]] -> [[1,M]]) |
samer@4 | 6 % ~'function to compute offsets', |
samer@4 | 7 % [[N,M]] ~'data to normalise' |
samer@4 | 8 % -> [[N,M]] ~'offset vectors' |
samer@4 | 9 % [[N,1]] | [[1,M]] ~'the vector that was subtracted'. |
samer@4 | 10 % |
samer@4 | 11 % This function can work row-wise OR column-wise depending on what |
samer@4 | 12 % the offset computing function returns. |
samer@4 | 13 % |
samer@4 | 14 % EXAMPLES |
samer@4 | 15 % |
samer@4 | 16 % To zero-mean each ROW of an N-by-M array X, use |
samer@4 | 17 % addnorm(@(t)mean(t,2),X); |
samer@4 | 18 % |
samer@4 | 19 % To zero the MEDIAN of each COLUMN, use |
samer@4 | 20 % addnorm(@median,X); |
samer@4 | 21 |
samer@4 | 22 Y=vecop1(@minus,X,F(X)); % vecshift(F(X),X); |
samer@4 | 23 |