Global Index (short | long) | Local contents | Local Index (short | long)
stdx = std_NaN(x);
stdx = std_NaN(x); x = matrix with the dimension that the 'std' should be calculated over in the first index.
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)]);