DADiSP Worksheet Functions > Function Categories > Series and Scalar Math > VSUM

 

VSUM

Purpose:

Returns the sum of one or more input arguments.

Syntax:

VSUM(val1, val2, ..., valN)

valN

-

One or more series or scalars.

Returns:

A real, the sum of the input values.

Example:

vsum(10, 15, 20)

 

returns 45.

Example:

vsum({1, 2, 3}, {0, 4, 2}, {0, 3, 8})

 

returns 34.

Example:

W1: gsin(100, 1/100, 1)^2

W2: gcos(1000, 1/1000, 1)^2

W3: gline(200, 1/200, 1, 0)

W4: concat(W1, W2, W3)

 

a = sum(W4);

b = vsum(W1, W2, W3);

 

a == b == 649.5

Example:

W1: ravel(1..9, 3)

W2: {sum(W1)}

W3: {vsum(w1)}

 

W1 == {{1, 4, 7},

       {2, 5, 8},

       {3, 6, 9}}

 

W2 == W3 == {45}

Remarks:

VSUM with no input arguments uses the current Window.

 

Non-numeric arguments are ignored.

 

Unlike SUM, the input values can consist of scalars and/or series.

 

See SUMS or VSUMS to compute the point by point sum of multiple input series.

 

See VMEAN to compute the mean of the input values.

See Also:

SUM

SUMS

VAVGS

VMAX

VMEAN

VMIN

VSUMS