11-28-2018 02:35 PM
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.
Solved! Go to Solution.
11-28-2018 02:50 PM
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.
11-28-2018 03:35 PM
OpenG has a function to do just that, if you are interested. Can be installed using VIPM.
11-28-2018 06:01 PM
@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.
11-28-2018 09:57 PM
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.