annotate general/numerical/alpha_norm.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 l=alpha_norm(alpha,x)
|
samer@4
|
2 % alpha_norm - Minkowski norm (actually more like mean) using given exponent
|
samer@4
|
3 %
|
samer@4
|
4 % alpha_norm :: nonneg ~'exponent', [[N,M]] -> [[1,M]->nonneg].
|
samer@4
|
5 % alpha_norm :: nonneg ~'exponent', [[1,N]] -> nonneg.
|
samer@4
|
6 %
|
samer@4
|
7 % This version divides by the dimemnsionality of the space,
|
samer@4
|
8 % eg
|
samer@4
|
9 % alpha_norm(2,x) = sqrt(mean(x.^2,1))
|
samer@4
|
10 % alpha_norm(1,x) = mean(abs(x),1))
|
samer@4
|
11 l=real(mean(abs(x).^alpha).^(1/alpha));
|
samer@4
|
12
|