MATLAB: Function ztest not found in R2015a

MATLABztest missing in matlab r2015a

Dear all,
when searching for ztest in R2015a I cannot find it. Does anyone know how can I add it? I did the same for ttest getting the same issue.
Regards,
Gilly

Best Answer

The core MATLAB functions erfc and erfcinv can emulate the normal probability distributions:
P = @(z) erfc(-z/sqrt(2))/2; % Equivalent to ‘normcdf’
CV = @(alpha) -sqrt(2) * erfcinv(2*alpha); % Equivalent to ‘norminv’
and the t-distribution is a one-line anonymous function:
tdist2T = @(t,v) (1-betainc(v/(v+t^2),v/2,0.5)); % 2-tailed t-distribution
tdist1T = @(t,v) 1-(1-tdist2T(t,v))/2; % 1-tailed t-distribution
where ‘t’ is the t-statistic and ‘v’ the degrees-of-freedom.