function [m,v]= normstat(mu,sigma);
%NORMSTAT Mean and variance for the normal distribution.
%   [M,V] = NORMSTAT(MU,SIGMA) returns the mean and variance of
%   the normal distribution with parameters MU and SIGMA.

%   References:
%      [1]  M. Abramowitz and I. A. Stegun, "Handbook of Mathematical
%      Functions", Government Printing Office, 1964, 26.1.26.

%   Copyright (c) 1993-96 by The MathWorks, Inc.
%   $Revision: 2.5 $  $Date: 1996/03/03 22:16:35 $

if nargin < 2, 
    error('Requires two input arguments.'); 
end

[errorcode mu sigma] = distchck(2,mu,sigma);

if errorcode > 0
    error('Requires non-scalar arguments to match in size.');
end

m = mu;
v = sigma .^ 2;

% Return NaN if SIGMA is negative or zero.
k = find(sigma <= 0);
if any(k)
    tmp  = NaN;
    m(k) = tmp(ones(size(k))); 
    v(k) = tmp(ones(size(k))); 
end
