Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

randnormal (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

Owning Class: statistics

Requires: MathScript RT Module

Syntax

randnormal('seed')

randnormal('seed', s)

c = randnormal

d = randnormal('seed')

c = randnormal(a)

c = randnormal(a, b)

c = randnormal([a, b])

Legacy Name: randn

Description

Generates normally distributed pseudorandom numbers. randnormal('seed') returns the seed of the pseudorandom number generator. randnormal('seed', s) sets the seed of the pseudorandom number generator to s. LabVIEW uses this seed to generate a pseudorandom number for the next call to the randnormal function. c = randnormal generates a single pseudorandom number. c = randnormal(a, b) is equivalent to c = randnormal([a, b]).

Examples

Inputs

Name Description
a Specifies the number of rows in c. a is a positive integer.
b Specifies the number of columns in c. b is a positive integer.
s Specifies the seed of the pseudorandom number generator to use for the next call to the randnormal function.

Outputs

Name Description
c Returns an a-by-b matrix of normally distributed pseudorandom numbers. If you do not specify b, c returns a square matrix of length a. The elements in c have an approximate mean of 0 and an approximate standard deviation of 1.
d Returns the seed of the pseudorandom number generator.

Examples

A = [3, 4]
C = randnormal(A)

S = randnormal('seed')
X = randnormal(10);
randnormal('seed', S)
Y = randnormal(10);

Related Topics

rand
random
randpermutation


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit