| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
Construct quasi-random number stream
q = qrandstream(type,d)
q = qrandstream(type,d,prop1,val1,prop2,val2,...)
q = qrandstream(p)
q = qrandstream(type,d) constructs a d-dimensional quasi-random number stream q of the qrandstream class, of type specified by the string type. type is either 'halton' or 'sobol', and q is based on a point set from either the haltonset class or sobolset class, respectively, with default property settings.
q = qrandstream(type,d,prop1,val1,prop2,val2,...) specifies property name/value pairs for the point set on which the stream is based. Applicable properties depend on type.
q = qrandstream(p) constructs a stream based on the specified point set p. p must be a point set from either the haltonset class or sobolset class.
Construct a 3-D Halton stream, based on a point set that skips the first 1000 values and then retains every 101st point:
q = qrandstream('halton',3,'Skip',1e3,'Leap',1e2)
q =
Halton quasi-random stream in 3 dimensions
Point set properties:
Skip : 1000
Leap : 100
ScrambleMethod : none
nextIdx = q.State
nextIdx =
1Use qrand to generate two samples of size four:
X1 = qrand(q,4)
X1 =
0.0928 0.3475 0.0051
0.6958 0.2035 0.2371
0.3013 0.8496 0.4307
0.9087 0.5629 0.6166
nextIdx = q.State
nextIdx =
5
X2 = qrand(q,4)
X2 =
0.2446 0.0238 0.8102
0.5298 0.7540 0.0438
0.3843 0.5112 0.2758
0.8335 0.2245 0.4694
nextIdx = q.State
nextIdx =
9Use reset to reset the stream, and then generate another sample:
reset(q)
nextIdx = q.State
nextIdx =
1
X = qrand(q,4)
X =
0.0928 0.3475 0.0051
0.6958 0.2035 0.2371
0.3013 0.8496 0.4307
0.9087 0.5629 0.6166haltonset,qrand, reset, sobolset
![]() | qrandstream class | qqplot | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |