Example Code

Reorder Elements in an Array

Code and Documents

Attachment

Overview

I have a data array full of elements but I would like to put them in a certain order. How can I accomplish this?

Description

The following VI is built so the user can indicate the desired corresponding index for each element in the mapping array. For example, if you would like data array element 0 to be in element 3, then the first element of your mapping array would be 3.

This method requires the programmer to know exactly how they would like to reorder their data array.


Steps to Implement or Execute Code

  1. Input desired order into mapping array
  2. Make sure you have a 1-D data

Requirements

Attached VI is written in LabVIEW 2014.

Additional Images or Video


Reorder array VI.PNG


Paul C

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors