Skip to main content
19-Tanzanite
September 20, 2023
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 IV
September 20, 2023

Here's one method:

LucMeekes_0-1695221182051.png

example:

LucMeekes_1-1695221194148.png

Success!
Luc

11 replies

LucMeekes23-Emerald IVAnswer
23-Emerald IV
September 20, 2023

Here's one method:

LucMeekes_0-1695221182051.png

example:

LucMeekes_1-1695221194148.png

Success!
Luc

Translate
Cornel19-TanzaniteAuthor
19-Tanzanite
September 20, 2023

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

Translate
Cornel19-TanzaniteAuthor
19-Tanzanite
September 20, 2023

@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