LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete duplicate in a array

Solved!
Go to solution

hyul,

Describe the functionality again please.

If a number in the first row repeats in the any other rows, do you  need to remove the ENTIRE ROW or THAT PARTICULAR REPEATING ELEMENT ALONE??

0 Kudos
Message 11 of 23
(4,960 Views)

i want to delete only the number not the entire row!

In fact i search the first number and i delete all the other.

here there is a small example witch explain what i want

0 Kudos
Message 12 of 23
(4,954 Views)

In the VI i attached, Since, i am deleting elelments in the array, the each rows size will not be same. So, each row will be appended by some zeros. Is that OK?

 

0 Kudos
Message 13 of 23
(4,947 Views)

i'm sorry but i cam't run it because i use labview 8.5, can you change the version of the VI?

0 Kudos
Message 14 of 23
(4,945 Views)
Solution
Accepted by topic author hyul

Sorry, I forgot.

Here it is..

0 Kudos
Message 15 of 23
(4,943 Views)

this is perfect, it's works

now i can continue my program

thanks a lot

0 Kudos
Message 16 of 23
(4,942 Views)

good one my frien!

0 Kudos
Message 17 of 23
(4,412 Views)

HOW DO YOU DO THAT WITH A 2D STRING ARRAY?

tHANKS

0 Kudos
Message 18 of 23
(2,526 Views)

Prefer Using My solution & give me if any bugs

0 Kudos
Message 19 of 23
(2,228 Views)

@rkbkgk wrote:

Prefer Using My solution & give me if any bugs


(First of all, this is not a solution because the input is not a 2D array as discussed.)

 

Your solution also scales very poorly for large input arrays (O(n²) because for each iteration, you start searching from the beginning, i.e. the first element gets touched over and over (N times!). In LabVIEW 2019, I would probably go with a "set" based solution if performance is a concern. Here's how that could look like (But LabVIEW 2019 already includes that array functionality as a vim :)). For the 2D case, you would just index out the key element and check the set.

 

keepuniques.png

 

Other solutions are also possible if output order is not important, e.g. if the input array is or can be sorted.

 

 

Message 20 of 23
(2,202 Views)