cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Array

SOLVED
Sim5
Member
Solved!

Delete Array

Hello.

I have a array and from which at some specific index i need to delete small portion of array like:

 

0 pass

1 pass

2 fail

3 fail

4 pass

5 fail

6 fail

no i have to delete  from above array, 1st three elements then two elemets and last remaing two elements which i am not able to do using delete array icon.

 

So if anyone can help me.

Thanks

18 REPLIES 18
Sim5
Member

Re: Delete Array

Message contains an attachment

Here is the example

David. B
NI Employee (retired)

Re: Delete Array

Hi Pals,

 

When you say you want to delete part of  the array do you mean you know exactly which elements you want to remove? Or do you want to delete all the elements that fail?

 

Regards

David B
Applications Engineer
National Instruments UK
Matthew_Kelton
Active Participant

Re: Delete Array

Well, if you run your VI in highlight execution mode, you will probably see that it is not doing what you want from the get go.  Why are you wiring the start index and the length to the same value?  Have you looked at the help file dor the function and understand how it works?

 

In your example, your first pass will delete 4 elements from the array starting at index 4, so indices 4, 5, 6, and 7.  Your start indices and lengths probably need to be different values.  Next, the way you are doing it, realize that your starting indices will continue to change.  You will probably want to do it backwards, so the end of the array is changing, not the beginning.  Then, you won't need to dynamically modify the indeices.

Sim5
Member

Re: Delete Array

Hello All,

Yes i am too confused so i posted it... my wish is 1st four elemets should be deleted then next next four and then remaining elemets... These four elements wont be constant so some times 1st two elemets then 6 elements etc...

 

Hope i am clear now...

Thanks

Matthew_Kelton
Active Participant

Re: Delete Array

How are you determining which elements should be deleted?

Sim5
Member

Re: Delete Array

hello,

I have very long program, So from another vi i get the values which to delete.. I have just posted part where i got stucked.

 

so 4, 8 etc values i get from other vi.

Thanks a lot..

Matthew_Kelton
Active Participant

Re: Delete Array

So explain in detail what 4, 8, 12 mean.  If you tell me to delete the 4 four elements, then the next 8, then the next 12, that's the same as deleting the first 24 elements.  You have to have offsets defined and lengths.  So, starting at index 0, I want to delete 4 elements, then at index ? I want to delete 8 elements, and so on.

 

Unless you only want to delete one value from the array at those indices, you're missing ssome info.

Sim5
Member

Re: Delete Array

Hello,

Thanks so much,

 

So here i go... from 0 index i want to delete 4 elements (not 4th elemets) but from 0 index till 4 index, then from 5th index till 8th index and then from 9th index till 12th index as i need these groups which futher dealed separately and differently from each other.

 

Thanks

Sim5
Member

Re: Delete Array

Hello,

I want these small groups which i get after deleting so independentely i can work on these groups...