LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Pnt

"Delete from Array" function should accept an array at index

Status: New

Currently there is no way to delete multiple elements in an array, that are not in sequence.

This way elements 2,4,7 would be deleted in just one function.

 

Delete from Array.png

 

It is cleaner code and in big arrays can enhange performance (at least i think)

14 Comments
Jim_Kring
Trusted Enthusiast

This is a great idea.  In fact, the OpenG team has already implemented something like this, here: http://wiki.openg.org/Delete_Elements_from_Array

 

 

 

 

RavensFan
Knight of NI

Pnt,

 

For some reason your image is missing and just shows up as a faded red X inside a box.

Pnt
Active Participant
Active Participant

Ravens, i can see it ok, with internet explorer.

It is something like Jim's image.

RavensFan
Knight of NI

I still can't see it.  Odd.  Is it in your image gallery?

 

The source says src="http://forums.ni.com/t5/image/serverpage/image-id/0i77E8814E25625E3B/image-size/medium/is-preview/tr..."  The is-preview makes me think  something is odd about it.

Pnt
Active Participant
Active Participant

Now it is.

Second try....

 

 

Delete from Array.png

 

RavensFan
Knight of NI
That worked.  It seems like a good idea, so I'll kudo it.
muks
Proven Zealot
Yes. I would also say kudos..................
altenbach
Knight of NI

The main argument would be performance, because using "delete from array" in a loop is a deadly sin. 😉

 

(An interesting discussion on how to do things better can be found here, read the entire thread!).

 

With an array input, it could internally do the entire thing much more efficiently, but do we really need it? Remember, for symmetry it must also support deleting from multidimensional arrays.

AristosQueue (NI)
NI Employee (retired)

> Remember, for symmetry it must also support deleting from multidimensional arrays.

 

Not necessarily. There's no reason we couldn't break the index input wire if the array input is 2 or more dimensions. Having said that, an array of rows or an array of columns to delete is just as legitimate as an array of indicies for a 1D array.

altenbach
Knight of NI

> Not necessarily.

 

Sorry, maybe I wasn't clear. My statement was just a (probably unecessary) reminder that it should also support deleting several rows or columns from 2D arrays or several planes from 3D arrays, etc.. All these cases would simply take an 1D array of indices.