LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete multiple elements from 2d array

Hi...

 

I have an 1D array ( array size 8041). How I can creat an array subset/ delete elements from the array. I need to keep every 4th element. The new 1D array size will be 2010. 

I need the element from every 4th index..............  0, (1,2,3), 4, (5,6,7), 8, (9,10,11),12, (13,14,15), 16.........................................,(8037,8038,8039), 8040.

I need to delete the element index in (   ).

 

xls file is attached

 

Please help me.

 

Thanks

 

 

0 Kudos
Message 1 of 6
(3,169 Views)

Do you always need every 4th element or do you need this to be variable during runtime?

If it's fixed, Decimate 1D array is probably the simplest solution.

If the spacing is variable you'll have to use a loop.

 

0 Kudos
Message 2 of 6
(3,164 Views)

Have you tried a search? This question has come up more times than I can count and plenty of solutions have been posted, along with variants and performance comparisons. Please do a search, try them out, and then come back if you can't find a solution.

 

Did you actually try any code? If so, post it, and indicate where you are having problems.

0 Kudos
Message 3 of 6
(3,159 Views)

 

 

Yes I just did the attach coding...........but I am missing the first element

 

thanks

 

Download All
0 Kudos
Message 4 of 6
(3,147 Views)

Based on your description you should use the first output array of the decimate function. This will contain elements 0, 4, 8, ...

 

0 Kudos
Message 5 of 6
(3,140 Views)

Thanks ....yes ..with first array it is working fine

 

0 Kudos
Message 6 of 6
(3,130 Views)