ArrayGetValuesByIndexArray Op

ArrayGetValuesByIndexArray

Pick values from input array at given indices and stride


<h4>Base example</h4> <pre><code class="language-js">const input_array = [&#39;I&#39;, &#39;love&#39;, &#39;not&#39;, &#39;cables&#39;]; const array_stride = 1; const index_array = [0, 1, 3];

const result = [&#39;I&#39;, &#39;love&#39;, &#39;cables&#39;]; </code></pre> <h4>Advanced case, changing the input stride</h4> <p>Changing the stride is helpful to pick values from Array2, Array3 or Array4. </p> <pre><code class="language-js">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]; </code></pre>


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)

<p>Input array with all values</p>

Array Stride index (Number:

<i>integer</i>

)

<p>1,2,3,4</p>

Indices (Array)

<p>List of indices to pick</p>

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