0001 function s = semedian(x,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 if nargin < 1,
0020 error('Incorrect number of parameters (type ''help <a href="matlab:help semedian">semedian</a>'' for details).');
0021 end
0022 if ~isdmatrix(x) & ~isdvector(x),
0023 error('Incorrect input - use vector or matrix (type ''help <a href="matlab:help semedian">semedian</a>'' for details).');
0024 end
0025
0026 if any(size(x)==1), x = x(:); end
0027
0028 n = size(x,1);
0029 m = repmat(nanmedian(x),n,1);
0030 s = sqrt( nansum((x-m).^2) / (n*(n-1)) );