Array Functions - Array Ops


These functions operate on a lua table containing numeric values but no string values, string keys, or sub-tables. This type of table is called an array, or indexed array, since the elements may be accessed by their index, as in x[5]. Except for arraytoimage, these functions support only 1-dimensional arrays. The arraytoimage function also supports 2-dimensional arrays. Many of these functions also work with an argument list consisting of numbers and pixel data of a CImage object.

Also see Array Functions - Math and Array Functions - Statistics.

Array Functions for General Array Operations

arrayindex,

arrayindex_b

Returns the the linear index of multi-dimensional coordinates in a multi-dimensional array. This function is the inverse of arraycoord.

arraycoord

Returns the coodinate array for an offset index. This function is the inverse of arrayindex.

arraytoimage

Converts a 1- or 2-dimensional array to a 1- or 2-dimensional CImage object.

flatten

Flattens the numeric values of a general table into an array.

list

Lists the contents of an array.

reverse

Reverses a 1-dimensional array with regard to the order of the array indices.

series

Creates and returns a 1-dimensional array containing uniformly spaced numbers.

sort

Sorts the numbers of a 1-dimensional array into ascending order.

sortr

Sorts the numbers of a 1-dimensional array into descending order.

Related Topics

Contents

Array Functions

Array Functions - Math

Array Functions - Statistics.

Table and Array Functions

Table Functions

CArray Class

CStats Class

CImage Class

CHistogram class


Mira Pro x64 Script User's Guide, v.8.80 Copyright Ⓒ 2025 Mirametrics, Inc. All Rights Reserved.