Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

rtrunray_pdf(x, sigma, D)
% rtrunray_pdf.m - tests a Right-Truncated Rayleigh Probability Density.
%   See "CFAR for Homogeneous Part of High-resolution Imagery", G. W. Lank et al., 
%   IEEE Trans Aerospace and Electronic Sys., Vol. 28, No. 2, April, 1992. 
%   Created by Jim Huntley,  11/20/09

function [pdf] = rtrunray_pdf(x, sigma, D)

%persistent coef sigmasq

    sigmasq = sigma^2;
    coef = 1 / (1-exp(-0.5*D^2/sigmasq));

pdf = coef .* x .* exp(-0.5.*x.^2/sigmasq) / sigmasq;


Contact us