truncarray
Shorten or extend an array.
Syntax
Usage
truncarray outputs a copy of an input array but either shorten or extends the values to match i/klen in length.
When the output array is shorter than the input array, then only the head of the array up to the 'i/klen index is returned.
If the output array is longer than the input array, then the values in the input array are repeated until i/klen is reached.
The optional argument iinc sums an increment to each element, which can produce interesting variations when extending.
--
Outputs and arguments
i/koutArr[] -- output array
i/kinArr[] -- input array
i/klen -- length of the output array
iinc -- an increment value to add to each output value.
Example
See the example for truncarray.orc