Documentation of std_NaN


Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)


Function Synopsis

stdx = std_NaN(x);

Help text


  stdx = std_NaN(x);

  x = matrix with the dimension that the 'std' should be calculated
  over in the first index.


Listing of function std_NaN

function stdx = std_NaN(x);

szx = size(x);
ndim = size(szx, 2);

if ndim > 2;
  x = reshape(x, [szx(1) prod(szx(2:ndim))]);
end;

stdx = NaN * ones(1, prod(szx(2:ndim)));
for i = 1:prod(szx(2:ndim));
  ind = find(~isnan(x(:,i)));
  if length(ind > 3);
    stdx(i) = std(x(ind,i));
  end
end

stdx = reshape(stdx, [1, szx(2:ndim)]);