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 ...
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
decimate.png:
http://forums.ni.com/attachments/ni/170/325893/1/decimate.png
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) ....
test38.vi:
http://forums.ni.com/attachments/ni/170/325906/1/test38.vi
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). ;)