Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > Functions

lognrnd

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

Generates a log-normal distributed random number. In order to reset the generator seed use the command randreset.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

out = lognrnd (mean,stddev);

Generates a lognormal distributed random number with user defined mean value and standard deviation.

 

Example

This example shows how to create an histogram of a log-normal distribution.

n = 1000;

y = matrix(n);

mean_val = 1;

std_dev = 0.25;

 

for (i=1:n){

    y(i) = lognrnd(mean_val, std_dev);

}

 

histc(y);

 

The histogram will look similar to the following one.

ref_scripts_examplelognrnd_zoom63

 

See Also

Functions, randreset, randn, histc

Copyright Lumerical Inc. | Privacy | Site Map