Graphics Programs Reference
In-Depth Information
ylabel('Probability density')
gtext('\mu = 0; \sigma = 1.5')
gtext('\sigma =1.5')
Listing 2.2. MATLAB Function Ðque_func.mÑ
function fofx = que_func(x)
% This function computes the value of the Q-function
% listed in Eq.(2.16). It uses the approximation in Eqs. (2.17) and (2.18)
if (x >= 0)
denom = 0.661 * x + 0.339 * sqrt(x^2 + 5.51);
expo = exp(-x^2 /2.0);
fofx = 1.0 - (1.0 / sqrt(2.0 * pi)) * (1.0 / denom) * expo;
else
denom = 0.661 * x + 0.339 * sqrt(x^2 + 5.51);
expo = exp(-x^2 /2.0);
value = 1.0 - (1.0 / sqrt(2.0 * pi)) * (1.0 / denom) * expo;
fofx = 1.0 - value;
end
Listing 2.3. MATLAB Program Ðfig2_3.mÑ
%This program generates Figure 2.3.
close all
clear all
logpfa = linspace(.01,250,1000);
var = 10.^(logpfa ./ 10.0);
vtnorm = sqrt( log (var));
semilogx(logpfa, vtnorm,'k')
grid
Listing 2.4. MATLAB Function Ðmarcumsq.mÑ
function Pd = marcumsq (a,b)
% This function uses Parl's method to compute PD
max_test_value = 5000.;
if (a < b)
alphan0 = 1.0;
dn = a / b;
else
alphan0 = 0.;
dn = b / a;
end
alphan_1 = 0.;
betan0 = 0.5;
Search WWH ::




Custom Search