Code covered by the BSD License
-
distrmu(distr, dpar)
DISTRMU a table-lookup function. For a given handle to an external
-
distrstat(distr, dpar)
-
simbinom(npoints, n, p)
SIMBINOM random numbers from binomial distribution
-
simdiscr(npoints, pdf, val)
SIMDISCR random numbers from a discrete random
-
simexp(M, N, lambda)
SIMEXP random numbers from exponential distribution
-
simgeom(npoints, p)
SIMGEOM random numbers from geometric distribution
-
simlinear(M, N)
-
simpareto(M, N, alpha)
SIMPARETO random numbers from Pareto distribution:
-
simparetonrm(M, N, alpha, gam...
SIMPARETONRM Generate a matrix of random numbers from the
-
View all files
|
|
| simexp(M, N, lambda)
|
function [sample] = simexp(M, N, lambda)
% SIMEXP random numbers from exponential distribution
% pdf f(x)=lambda exp(-lambda*x), x>0
%
% [sample] = simexp(M, N, lambda)
%
% Inputs:
% M - number of rows in the output matrix
% N - number of columns in the output matrix
% lambda - parameter of the distribution
%
% Outputs:
% sample - a matrix of random numbers
%
% See also SIMBINOM, SIMDISCR, SIMGEOM, SIMPARETO
% Authors: R.Gaigalas, I.Kaj
% v1.3 Created 04-Oct-02
% Modified 02-Dec-05 to generate a matrix
% generate a sample of U(0, 1) and apply the inverse cgf
sample = -log(rand(M, N))./lambda;
|
|
Contact us at files@mathworks.com