Skip to main content
19-Tanzanite
Sep 20, 2023 2:24 PM UTC
Solved

How to eliminate duplicate elements from a vector?

Hello,

I have this vector:

 

Cornel_2-1695219548958.png

 

I want automatically to eliminate duplicate elements, and to retain only those elements which are not duplicate from the vector:

Cornel_3-1695219713745.png

How to do this?

LucMeekesAnswer
23-Emerald V
Sep 20, 2023 2:46 PM UTC

Here's one method:

LucMeekes_0-1695221182051.png

example:

LucMeekes_1-1695221194148.png

Success!
Luc

11 replies

LucMeekes23-Emerald VAnswer
23-Emerald V
Sep 20, 2023 2:46 PM UTC

Here's one method:

LucMeekes_0-1695221182051.png

example:

LucMeekes_1-1695221194148.png

Success!
Luc

Translate
Cornel19-TanzaniteAuthor
19-Tanzanite
Sep 20, 2023 2:54 PM UTC

Thank you.
If there are other solutions and other ideas (from anyone) they are welcome as well.

Translate
Cornel19-TanzaniteAuthor
19-Tanzanite
Sep 20, 2023 3:19 PM UTC

@LucMeekes 

 

Cornel_0-1695223035844.png

 

 

Cornel_0-1695223468106.png

Why in the second case function does not work properly? Why I need to give separately entire vector, and not t variable? In the first case it worked...

Translate