You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Variable Library > storeAt

18.8 storeAt

var.storeAt(name, numericValue, col [, row])

Stores a numeric value into an element of a math list or matrix with the given name. col is a 1-based column number of the matrix or list. row is a 1-based row number. row is only required when storing a value into a matrix.

The value must be numeric. Any other type raises an error.

New values can be appended to a list by storing to one column past the end of the list. This function is useful particularly as an optimization when adding new values to a list during a simulation.

Returns nil on success or “cannot store” if the value cannot be stored at the given index.

Introduced in platform.apiLevel = '2.0'