Example Code

Zero Pad an Array Using LabVIEW

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

Download All

Overview

This VI will zero pad an input array with a specified number of zeros

 

Description

The example adds zeros in the first elements of an Input Array. The user is providing the number of zeroes, and then a sub array of zeros is created and initialized with the numbers of zero provided. This created sub array is being pushed to the beginning of the Input Array, and creating a zero pad Output Array, which contains, in the first elements, the number of zeros provided by the user, and then the original elements of the Input Array.

 

Requirements

  • LabVIEW 2012 (or compatible)

Steps to Implement or Execute Code

  1. Manually Initialize the Input Array
  2. Modify the Number of Zeroes Control
  3. Run the VI

Additional Information or References
VI Block Diagram

Zero-pad Array LV2012 NI Verified BD.jpg

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

John Passiak

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