Example Code

Compare the First Row of An Array to Other Rows

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
Compare each element in the first row of a 2D array with its corresponding element in other rows.

 

Description
The polymorphic nature of the subtract node makes the “row subtraction” possible. In other words, there is no need to subtract elements in each row one by one. The polymorphic subtract node will detect the subtractor and subtractee to be arrays and perform the “row subtraction” directly. The two dimensional array in the example code can be extended to the length you want.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Add data to the two dimensional array in the front panel.
  2. Run the VI.

 

 

Additional Information or References
VI Block Diagram
code.png

 

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

 

 

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