Find elements of a vector
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tom
am 12 Feb. 2014
Kommentiert: Azzi Abdelmalek
am 12 Feb. 2014
If I have a vector, e.g.
A = [ 2 8 6 5 3 3 6 5 5 3 4 1 2 9 6]
How do I return a vector which just gives single examples of the elements of A, e.g.
B = [1 2 3 5 6 8 9]
Kind regards,
Tom
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 12 Feb. 2014
Bearbeitet: Azzi Abdelmalek
am 12 Feb. 2014
B=unique(A)
You can make the result without sorting
B=unique(A,'stable')
6 Kommentare
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!