From 6e340c2ce88948bde2f685629dd0c8eba3e0cdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Sun, 18 Sep 2011 00:12:33 +0200 Subject: [PATCH] Fixed typos in headers and cosmetic changes. --- matlab/utilities/general/nandemean.m | 7 ++++--- matlab/utilities/general/nanmean.m | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/matlab/utilities/general/nandemean.m b/matlab/utilities/general/nandemean.m index 55afdb0f9..ad6c715e9 100644 --- a/matlab/utilities/general/nandemean.m +++ b/matlab/utilities/general/nandemean.m @@ -49,10 +49,11 @@ function c = nandemean(x) % AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT fr -if ndim(x)==1 +switch ndim(x) + case 1 c = x-nanmean(x); -elseif ndim(x)==2 + case 2 c = bsxfun(@minus,x,nanmean(x)); -else + otherwise error('descriptive_statistics::nandemean:: This function is not implemented for arrays with dimension greater than two!') end \ No newline at end of file diff --git a/matlab/utilities/general/nanmean.m b/matlab/utilities/general/nanmean.m index 3d4515018..6b66bad0f 100644 --- a/matlab/utilities/general/nanmean.m +++ b/matlab/utilities/general/nanmean.m @@ -3,7 +3,7 @@ function y = nanmean(x) %@info: %! @deftypefn {Function File} {@var{y} =} nanmean (@var{x}) -%! @anchor{nandemean} +%! @anchor{nanmean} %! @sp 1 %! Computes the mean of each column of a matrix with some NaNs. %! @sp 2 @@ -16,7 +16,7 @@ function y = nanmean(x) %! @strong{Outputs} %! @table @ @var %! @item y -%! Matlab matrix (T-by-N). The demeaned x matrix. +%! Matlab vector (1-by-N), the mean. %! @end table %! @sp 2 %! @strong{This function is called by:} @@ -25,7 +25,7 @@ function y = nanmean(x) %! @sp 2 %! @strong{This function calls:} %! @sp 1 -%! @ref{ndim}, +%! @ref{ndim} %! %! @end deftypefn %@eod: