Functions Index :: A :: ArrayDeplex

[<< up one level]

Module:

array :: slices

Definition:

ArrayDeplex(string array, int index, int num_plexed_arrays)

Description:

Demultiplexes the array passed as argument and returns the speficied subarray (to multiplex arrays use ArrayPlex).

Arguments:

array: The array to operate on.

index: The index of the demultiplexed subarray of array to return as result. Must be in the range [0..num_plexed_arrays).

num_plexed_arrays: The number of multiplexed subarrays that array holds.

Notes and conditions on arguments relations:

Demultiplexing is performed by dividing array into blocks of num_plexed_arrays elements and taking the index element of each block, appending it to the resulting array.

In effect the function treats array as a matrix of num_plexed_arrays columns and returns its index column.

Examples:

coords = "10,20,30,70,50,120,70,140,90,100,110,80"

# assuming coords is a [x,y] matrix (2x6), get x and y

ax = coords.ArrayDeplex(0, 2)

# ax == "10,30,50,70,90,110"

ay = coords.ArrayDeplex(1, 2)

# ay == "20,70,120,140,100,80"

...

# assuming coords is a [x,y,z] matrix (3x4), get z

z = coords.ArrayDeplex(2, 3)

# z == "30,120,90,80"

 

[<< top]