LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add 3 zero after every n element in an array

Hi, I have an array that has 50 elements ( 0 and 1) . I would like to add 3 zero after every 5 elements . As below for the first 10 elements

 

 

10101010111111101001 should become  10101010110001111101001000

 

could you please help me on this one ? I would greatly appreciate if youd attach the code for it

thanks

0 Kudos
Message 1 of 4
(2,444 Views)

This seems to do it.  If you have an older version of LV which does not have the Concatenating Tunnel option, you can concatenate with Build Array.

 

I used controls for the Interval and Number of Zeros to make it more versatile if you ever need to change the parameters.

 

Lynn

 

Array Extender.png

 

0 Kudos
Message 2 of 4
(2,424 Views)

Isn't For loop better choice...??


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 3 of 4
(2,406 Views)

Approach with for loop 😄

 

AnotherWay.png

0 Kudos
Message 4 of 4
(2,392 Views)