LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

store data in alternating sequence

hello ,
 
i want to store data in a alternating sequence .  i generate data , random data ...lets say , a total of  30 digitis . now instead of just storing them in a array , what i would like to do is .. store the first element in the first array , the second element in the second array , the third
element in the first array , the fourth in the second array , the fifth in the first array and the sixth in the second array and so on ..
more like the odd numbered elements should get stored in the first array and the even numbered elements  in the  second array .
hope someone can give me some idea on how to get this done ....
 
Motorhead ...
0 Kudos
Message 1 of 7
(3,311 Views)
0 Kudos
Message 2 of 7
(3,309 Views)
Once you have all elements in one array, use "decimate 1D array" (from the array palette, resized to two outputs) for the desired outcome.
 
See image:
 

(by LabVIEW definition, the first element is index#0 (even) and the 30. element is index #29 (odd). Tweak as needed).

Message Edited by altenbach on 05-22-2008 10:39 PM
Message 3 of 7
(3,300 Views)

Smiley Very Happy I had never noticed it.

0 Kudos
Message 4 of 7
(3,285 Views)

Hi , 

  I sure did what you recommended , but i am not able to understand what the first four elements in both the end  arrays represent .

Could you please explain ? .

Motorhead (feel like a dickhead now) ....

0 Kudos
Message 5 of 7
(3,270 Views)
You need to initialize the shift register with an empty array, currently it contains four elements. (set the index to 0 to see them all).
 
Simply right-click the array...data operation...empty array.
 
 
This code will probably not do what you want, because it will place all elements with an odd value in one array and all even values in the other array.
 
If I read your original question correctly, you want the values with odd array indices (not values!) in one array and the elements with even indices in the other.
 
Why don't you try the decimate suggestion?
 
(Also, remember that the number of visible elements has no relation to the array size). 😉
0 Kudos
Message 6 of 7
(3,259 Views)
will do so ... thank you
 
 
0 Kudos
Message 7 of 7
(3,239 Views)