MATLAB: Z score to p values

normcdfstatistics

I have a large matrix 1xN containing z values. I would like to know how to turn these z scores to p values using normcdf function?
How to obtain p values both for one-tailed and two-tailed p values using normcdf?
Many thanks in advance!

Best Answer

If I remember correctly, the probability of a one-tailed test is twice the probability of a two-tailed test, so:
p_one = 2*normcdf(z_vector);
p_two = normcdf(z_vector);