% sum2nan.m                                                Steve Mann, 1989
%
% 2-dimensional sum
%
% Use:  y = sum2(A); % returns sum over all non NaN elements of A
%       [y, count] = sum2nan(A);  % also returns number of non NaN entries
%
% See also: sum2, min2, max2, min2nan, max2nan, stats

function [b,count] = dummy(A)

if nargout==1 | nargout==0
  b=sum(sum(chnan(A,0)));
end%if
if nargout==2
  b=sum(sum(chnan(A,0)));
  [M,N]=size(A);
  count=M*N-sum(sum(isnan(A)));  % number of non NaN entries
end%if

