LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I populate blanks instead of zero in a 2D array?

Is there a way to insert blank vs zeros into a 2D array? I have some 1D array (some of them only contain 1 numeric digit) as inputs to my build array function and the output of this build array function is a 2D array therefore some of the empty spaces will be filled with zeros. How can I replace those zeros with blanks?
0 Kudos
Message 1 of 5
(3,595 Views)
it seems impossible in numerical arrays.
however, if you can accept outputs in string format, then you may check the input numerical array for zeros and replace them with empty strings.

does this makes sense??

regards
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 2 of 5
(3,595 Views)
I don't think you can populate them with blanks, but you could populate with
NaN. To create a NaN take and divide 0/0, then turn the indicator into a
constant. Now you can input that constant anywhere you want.

"Anthony_V" wrote in message
news:506500000008000000606E0000-1031838699000@exchange.ni.com...
> Is there a way to insert blank vs zeros into a 2D array? I have some
> 1D array (some of them only contain 1 numeric digit) as inputs to my
> build array function and the output of this build array function is a
> 2D array therefore some of the empty spaces will be filled with zeros.
> How can I replace those zeros with blanks?
0 Kudos
Message 3 of 5
(3,595 Views)
Actually, you can just type "nan" into a floating point diagram constant, no need to do any math...
0 Kudos
Message 4 of 5
(3,595 Views)
Hi Anthony,

The other answers already posted address your question directly.

Now for something different.

If you put a 1-d array inside a cluster, and then put that cluster inside an array, you will not have to deal with the blanks at all!

This will require an additional "bundle" when building and anothe un-bundle when un-packing, but does side-step the "rectactular" requirement of 2-d arrays.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 5
(3,595 Views)