How to find if a vector has a repetitive element or not? And its repetition number

4 次查看(过去 30 天)
For example
A=[ 1 3 1 1 2 3 5]

采纳的回答

Torsten
Torsten 2018-10-23
编辑:Torsten 2018-10-23
[a,b] = histc(A,unique(A));
count = a(b)
returns the number of occurences of each element in vector A in array "count".
Best wishes
Torsten.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by