Rmsspa (dest, swath, source), Rnd (source), Dest x i swath – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 197

Advertising
background image

Section 8. Processing and Math Instructions

8-25

RMSSpa (Dest, Swath, Source)

Used to compute the RMS value of an array.

Syntax
RMSSpa(
Dest, Swath, Source)

Remarks
Spatial RMS, Calculate the root mean square of values in an array.

(

)

Dest

X i

swath

i j

i j swath

=

=

= +

( )

2

Where X(j) = Source

Parameter
& Data Type

Enter

Dest
Variable

The variable in which to store the RMS value.

Swath
Constant

The number of values of the array to include in the RMS calculation.

Source
Array

The name of the variable array that is the input for the instruction.

RmsSpa Function Example

The example uses the RmsSpa function to

RND (Source)

The RND function is used to generate a random number.

Syntax
RND( source )

Remarks
The RND function returns a single value less than 1 but greater than or equal to
0.

The same random-number sequence is generated each time the instruction is
encountered because each successive call to the RND function uses the
previous random number as a seed for the next number in the random-number
sequence.

The value of the Number argument determines how the random number will be
generated:

Value

Description

< 0

The same number each time, as determined by Number

> 0

The next random number in the sequence

= 0

The number most recently generated

Number omitted The next random number in the sequence

Advertising