DADiSP Worksheet Functions > Function Categories > Data Manipulation and Editing > SETPT

 

SETPT

Purpose:

Modifies the nth value of a series.

Syntax:

SETPT(series, value, index)

series

-

Optional. Any series or multi-column table. Defaults to the current Window.

value

-

A real, the value used to replace the current value.

index

-

An integer, the point index.

Example:

a = {1, 2, 3}

a = setpt(a, 10, 3)

 

sets the third point in the series a to 10. This is equivalent to a[3] = 10.

Remarks:

An index n refers to the nth point in the series, therefore the new value is assigned to the nth point in the series.

 

The following array syntax also sets values in a series:

 

Wn[index] = value

 

For example: W3[2] = 10.

 

See .. (Range Specifier) for more array syntax examples.

 

SETPT is useful when using expressions containing CURR. For example,

 

W1: 1..8;setpt(curr, 0, 2)

 

creates the series {1, 0, 3, 4, 5, 6, 7, 8}

 

W1: 1..8;W0[2] = 0

 

creates the same series since W0 refers to the current Window.

See Also:

.. (Range Specifier)

CURRENT

GETPT

W0