annotate general/numerical/alpha_norm.m @ 6:0ce3c2070089
Removed duplicate code and fixed doc in timed_action.
author |
samer |
date |
Mon, 14 Jan 2013 14:33:37 +0000 |
parents |
e44f49929e56 |
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
|