contextSum

Syntax

contextSum(X, Y)

Arguments

X and Y are vectors, matrices or tables.

Details

Get of positions that are not NULL in both X and Y, and calculate the sum of the elements in X on these positions.

Examples

contextSum(1 2 3 4 5, 2 3 4 5 6)
// output
15

contextSum(1..3, true false true)
// output
6

contextSum(1 2 NULL, 1 NULL 3)
// output
1

Related functions: contextCount, contextSum2