Investment Studio > Expressions > Functions > DSP > RECTANGLE

Vector form: float array[1][length] rectangle(integer length)

Returns a row vector (one row, length columns) containing the values of a rectangular window starting at position 1 and ending at position length > 1.

Scalar form: float rectangle(integer length, integer position)

Returns the value in position >= 1 of a rectangular window starting at position 1 and ending at position length > 1.

The value of the rectangular window function is 1 if 1 <= position <= length, 0 otherwise.

Example

The graph source

=rectangle(100, x)

can be used to create the following graph:

See also blackman, convolve, hamming, hanning, triangle.