08-11-2010 07:35 AM
Hi,
i x i x
0 10 to 0 10
1 20 3 40
2 30 6 55
3 40 9 70
4 45
5 50
6 55
7 60
8 65
9 70
I am trying build a 2D array with the extracted values: one array being the index, and the other is the value of that index shown above.
The goal is to extract every n elements (n=3 in this example shown above) out of an array and index the elements and put them in a 2D array. I used the "decimate.vi", and it can extract the element but unable to provide me the index of that element , so does any one know a more efficient solution to program this?
Please help
Thank you
08-11-2010 08:08 AM
Here is how I would do it.
08-11-2010 01:28 PM
Thanks for the help. Aeastet, can you please save as the VI in labview 2009, as I am using labview 2009, or show the true case structure screen shot, as I cannot see the true case structure program base on the posted screen shot.
Thank you
08-11-2010 01:37 PM - edited 08-11-2010 01:39 PM
Here you go
08-11-2010 01:44 PM
I am a 'decimator' myself. Only with arrays, not in the Roman sense.
08-11-2010 03:57 PM - edited 08-11-2010 03:59 PM
Your problem is not very well defined, so I make some assumptions.
I assume the input array is 1D, and the index is implicit. Here's my solution:
It would be trivial to adapt to a version with a 2D array input. try it! 🙂