You can use normcdf
function available in Matlab to get p values of normal distribution. Here is an example code:
main.m422 chars12 lines
In this example code, normcdf
is used to calculate the CDF of standard normal distribution for the absolute value of p
. The p value is then calculated by multiplying the result by 2 on the basis of two-tailed t-test.
gistlibby LogSnag