ADD inputVector inputVector {inputVector} resultVariable

Adds each element of the first input vector to the corresponding element of all the other input vectors and copies the sum into the corresponding element of the result vector.

If the input vectors are of different lengths, the shorter vectors will be "extended" to the length of the longest by repeating their last element as many times as necessary. This extension is only done internally and does not change the actual size or content of the shorter vectors.

If any element is a "missing" value (represented by a "." Or "NaN") the result for that position will also be missing.

COPY -5,5   vec1
COPY 1,5 vec2
ADD vec1 vec2 answer
Print vec1 vec2 answer

The above program produces the following output:

vec1: (-5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0)

vec2: (1.0 2.0 3.0 4.0 5.0)

answer: (-4.0 -2.0 0.0 2.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0)

Note that the size of vec2 is unchanged.