Example Code

Remove Values from Array

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example removes a user specified value from an input array.


Description
This code uses array size and other array vi to complete this function. The output array is shortened by the number of elements removed


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Run VI

 

Additional Information or References
VI Block Diagram

 Block Diagram.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

 

James K.
National Instruments
Applications Engineer

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

Comments
Mads
Active Participant
Active Participant
on

You can find this and several other nice functions in the OpenG toolkit. The key when doing this is to not use the delete primitive repeatedly as it causes costly memory reallocations. Try to feed a large array with lots of removable items into the function and you'll se that it takes a lot of time. This VI does the job without the repeated delete operations (and is even quicker than the OpenG function as it does not bother to output the indices of the removed elements).