From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimating a 1D-Array

Hallo,

I need to decimate a 1D-Array:

1 2 3 4 5 6 1 2 3 4 5 6

must be saved to a file like

1 2 3 4 5 6
1 2 3 4 5 6

I managed to do that al ready. The next array is like this:

1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0

It must be saved as

1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0

How can I calculate the number of columns and how can I tell it to LabVIEW? If not required, I don't want to write a new VI (or Select Case thing) for every number
0 Kudos
Message 1 of 2
(2,224 Views)
This answer is assuming your arrays will always be constructed the way you show them, the same number of elements repeating themselves twice.

Take a look at the attached image. It uses the 'Reshape Array' function to transform the 1D array into a 2D array. This should work for any size of input array. Your 2D array can then be saved as you are doing now.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 2
(2,224 Views)