Skip to main content

The "array_create_ext" Function

Syntax#

array_create_ext(size_x, size_y, [size_z], [size_w], ..., value);
ArgumentTypeDescription
size_xintegerSets the number of cells in the first dimension of the array
size_yintegerSets the number of cells in the second dimension of the array
[size_z]integerOptional: Sets the number of cells in the third dimension of the array
[size_w]integerOptional: Sets the number of cells in the fourth dimension of the array
...integerOptional: Sets the number of cells in any additional dimensions of the array
valueanySets a value to assign to all new cells (default 0)

Description#

Returns an array of multiple dimensions and assigns a default value to the lowest level cells.

At least two dimensions and a default value must be supplied. Additional arguments will be interpreted as dimension sizes preferentially, with the last argument always being the default value.

Example#

my_2d_array = array_create_ext(5, 10, 0);
my_3d_array = array_create_ext(5, 10, 3, pi);
my_4d_array = array_create_ext(5, 10, 3, 6, "init");