File Exchange

image thumbnail

Laplacian random number generator

version 1.0 (714 Bytes) by

Generate i.i.d. random number drawn from laplacian distribution with specified parameter

9 Ratings



No License

function y = laprnd(m, n, mu, sigma)
%LAPRND generate i.i.d. laplacian random number drawn from laplacian distribution
% with mean mu and standard deviation sigma.
% mu : mean
% sigma : standard deviation
% [m, n] : the dimension of y.
% Default mu = 0, sigma = 1.
% For more information, refer to

Comments and Ratings (9)

Seyed Resalat

Thanks Man!!


haha (view profile)


Alex (view profile)


Li Dong

Li Dong (view profile)

Dear U helped very much. I got what i was doing for 2 days. Thank you very much

Nishank Pathak


Osman Gulseven

Does the Job

Abdellatif Salah

well done

John D'Errico

It does what it says. Its vectorized, well coded, with good help, some error checks (ok, it does not check for sigma<0, nor worry about the shapes of its arguments), it has default values for the parameters, an H1 line, a reference to wikipedia. These are all things I like very much to see.

In my obsessive drive for completeness, I'd want to see also tools for the pdf, cdf, and inverse cdf. I wanted to rate this about a 4.5 as is.

MATLAB Release
MATLAB 7.1.0 (R14SP3)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today