Documentation

qfunc

Syntax

Description

example

y = qfunc(x) returns the output of the Q function for each element of the real array x. The Q function is one minus the cumulative distribution function of the standardized normal random variable.

Input Arguments

collapse all

x — Inputscalar | vector | matrix | N-D array

Input, specified as a real scalar or array.

Output Arguments

collapse all

y — Q function outputscalar | vector | matrix | N-D array

Q function output, returned as a real scalar or array having the same dimensions as input x.

Examples

collapse all

Q Function Results and Plot

Determine the values of the Q function for an input vector.

x = -4:0.1:4;
y = qfunc(x);

Plot the results.

plot(x,y)
grid

Calculate QPSK Error Probability Using Q Function

Convert an input Eb/No in dB to its linear equivalent.

ebnodB = 7;
ebno = 10^(ebnodB/10);

Determine the QPSK error probability, $P_b$, given that:

$$P_b = Q\left(\sqrt{2\frac{Eb}{No}}\right).$$

Pb = qfunc(sqrt(2*ebno))
Pb =

   7.7267e-04

More About

collapse all

Algorithms

For a scalar x, the formula is

Q(x)=12πxexp(t2/2)dt

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

Q(x)=12erfc(x2)

See Also

| | | | |

Introduced before R2006a

Was this topic helpful?