LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete specific numeric columns from array

Solved!
Go to solution

Hello,

 

How to go about deleting specific numeric columns values from 2D array?

 

In the attached VI, I would like to delete columns 1, 3 and 4.

 

Thanks.

0 Kudos
Message 1 of 5
(2,226 Views)
Solution
Accepted by topic author hiNI

Delete From Array.

 

Do it in a loop with a shift register.

 

Start at the highest column number and work down.  Why?  Because if you delete column 1 first, then columns 3 and 4 become 2 and 3 and you'll have to keep track of that.  Start near the end and the columns before that will remain the same numbers.

Message 2 of 5
(2,221 Views)

OpenG has a function to do just that, if you are interested.  Can be installed using VIPM. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 5
(2,199 Views)

@RavensFan wrote:

Delete From Array.

 

Do it in a loop with a shift register.


Of course there are algorithms that are significantly faster. Each delete operation needs to touch (move in memory) every single higher element so after you used Delete from array N times, the highest array elements has been shuffled around N times. This can get very expensive for large arrays and large number of deletions. There are better way as has been discussed many times here.

 

It is even worse for columns because column elements are not adjacent in memory.

 

0 Kudos
Message 4 of 5
(2,180 Views)

Hello,

 

My columns are actually extremely large.  Can you give me an example link to look for a solution to delete the large columns?

 

Thanks.

0 Kudos
Message 5 of 5
(2,162 Views)