remove the frequent values withou sorting
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
huda nawaf
am 10 Jul. 2022
Kommentiert: huda nawaf
am 11 Jul. 2022
hello
I need a function remove the frequent values(keeping the first appearance of value) without using unique because it is making sortg
For example
x=[3 4 3 5 1 0 4 2];
I need x to be
x=[3 4 5 1 0 2]
Thanks in advance
0 Kommentare
Akzeptierte Antwort
the cyclist
am 10 Jul. 2022
You can still use unique:
x = [3 4 3 5 1 0 4 2];
x = unique(x,"stable")
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!