Accelerating the pace of engineering and science

# qfunc

Q function

y = qfunc(x)

## Description

y = qfunc(x) is one minus the cumulative distribution function of the standardized normal random variable, evaluated at each element of the real array x. For a scalar x, the formula is

$Q\left(x\right)=\frac{1}{\sqrt{2\pi }}\underset{x}{\overset{\infty }{\int }}\mathrm{exp}\left(-{t}^{2}/2\right)dt$

The Q function is related to the complementary error function, erfc, according to

$Q\left(x\right)=\frac{1}{2}\text{erfc}\left(\frac{x}{\sqrt{2}}\right)$

## Examples

The example below computes the Q function on a matrix, element by element.

```x = [0 1 2; 3 4 5];
format short e % Switch to floating point format for displays.
y = qfunc(x)
```y =