ArrayGetValuesByIndexArray Op

ArrayGetValuesByIndexArray

Pick values from input array at given indices and stride


Base example

const input_array = ['I', 'love', 'not', 'cables'];
const array_stride = 1;
const index_array = [0, 1, 3];

const result = ['I', 'love', 'cables'];

Advanced case, changing the input stride

Changing the stride is helpful to pick values from Array2, Array3 or Array4.

const input_array = [0,0,0, 1,1,1, 2,2,2];
const stride = 3;
const index_array = [0, 2];

const result = [0,0,0, 2,2,2];

Full Name
  • Ops.Array.ArrayGetValuesByIndexArray
Visibility
  • Core Op - Official cables op
License
  • MIT
Authorgithub


Example Patch ArrayGetValuesByIndexArray example

Demonstrate how to use ArrayGetValuesByIndexArray OP

Open In Editor

INPUT PORTS


Array (Array)

Input array with all values

Array Stride index (Number: integer)

1,2,3,4

Indices (Array)

List of indices to pick

OUTPUT PORTS


Results (Array)

Patches using ArrayGetValuesByIndexArray

  • Examples
  • Public
  • My Patches

Changelog


created opuser avatarkikohs - 2023-02-28 18:14
cloned op from Ops.User.kikohs.ArrayGetValuesByIndexArrayuser avatarstephan - 2023-03-06 14:22
renameOps.User.stephan.ArrayGetValuesByIndexArray renamed to Ops.Dev.Arrays.ArrayGetValuesByIndexArrayuser avatarstephan - 2023-03-06 15:12
renameOps.Dev.Arrays.ArrayGetValuesByIndexArray renamed to Ops.Arrays.ArrayGetValuesByIndexArrayuser avatarstephan - 2023-03-06 15:16
renameOps.Arrays.ArrayGetValuesByIndexArray renamed to Ops.Array.ArrayGetValuesByIndexArrayuser avatarpandur - 2023-12-06 09:29