Exercise 3.3: Vector Sum and Difference

Given: two vectors, x, and y, of equal size and range;
Compose: a loop that returns four vectors, containing, respectively, the element-wise sum and difference of the two vectors, and the sums of the elements in each of the two vectors.
for in 1, size
returns array of x[i] + y[i]
        array of x[i] - y[i]
        value of sum x[i]
        value of sum y[i]
end for

Previous Section