Find elements of a vector
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Azzi Abdelmalek
2014-2-12
编辑:Azzi Abdelmalek
2014-2-12
B=unique(A)
You can make the result without sorting
B=unique(A,'stable')
6 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!