LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete index from array

Hi Everybody,

I would like to delete some index from array. for example, in figure, 0, 3,6 and 9 index number (array 2) are delete from array 1. How can I do it.

thank you

0 Kudos
Message 1 of 5
(3,699 Views)

Hi 1085,

 

there's a DeleteFromArray function - just use it!

(Hint: start deleting with the highest index.)

 

It's a nice exercise to learn usage of FOR loops, autoindexing and shift registers.

You should be able to solve this after taking the GettingStarted section in the header of the LabVIEW board!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,695 Views)

Thank you for reply. How is deleting started  with the highest index. Can you send me example.

 

0 Kudos
Message 3 of 5
(3,681 Views)

Hi 1085,

 

you have the indices to be deleted in an array, sorted from lowest to highest: just use Reverse1DArray to have the indices starting from highest…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(3,667 Views)

Yes there is also the OpenG option which has a delete elements from array, which allows you to specify an array of indexes to delete.  It will sort them and remove duplicates so that the delete goes from highest to lowest.

0 Kudos
Message 5 of 5
(3,621 Views)