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

randn (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the statistics class.

Syntax

randn('seed')

randn('seed', s)

c = randn

d = randn('seed')

c = randn(a)

c = randn(a, b)

c = randn([a, b])

Description

Generates normally distributed pseudorandom numbers. randn('seed') returns the seed of the pseudorandom number generator. randn('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 randn function. c = randn generates a single pseudorandom number. c = randn(a, b) is equivalent to c = randn([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 randn 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 = randn(A)

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

Related Topics

rand
random
randperm


Resources


 

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