To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI takes an Array with NaN (not a Number) values and interpolates new values to fill in for the NaN data.
This VI is designed to work with data with a constant delta X value and this algorithm will not work for generating the first or last data point in an array. This example is useful because interpolates new values from an Array with NaN values.
Description
Use For the iterates every Array Value then the Index Array is looking for NaN Values. The While Loop continues iterate through the array until you find valid data (looks for long chains of NaN). After that a For Loop generates the Missing Values (last known value + step size*(i+1)) and finally the Array Subset replace the NaN Value.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
1. Y in Array Control is a predefined Array that does have some NaN values
2. Run VI
3. Y Repaired Indicator Array will show interpolate values where NaN values were in Y in Array
Additional Information or References
**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.