Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

random

Class: piecewisedistribution

Random numbers from piecewise distribution

Syntax

r = random(obj)
R = random(obj,n)
R = random(obj,m,n)
R = random(obj,[m,n])
R = random(obj,m,n,p,...)
R = random(obj,[m,n,p,...])

Description

r = random(obj) generates a pseudo-random number r drawn from the piecewise distribution object obj.

R = random(obj,n) generates an n-by-n matrix of pseudo-random numbers R.

R = random(obj,m,n) or R = random(obj,[m,n]) generates an m-by-n matrix of pseudo-random numbers R.

R = random(obj,m,n,p,...) or R = random(obj,[m,n,p,...]) generates an m-by-n-by-p-by-... array of pseudo-random numbers R.

Examples

Fit Pareto tails to a t distribution at cumulative probabilities 0.1 and 0.9:

t = trnd(3,100,1);
obj = paretotails(t,0.1,0.9);

r = random(obj)
r =
    0.8285

See Also

| |

Was this topic helpful?