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

4 Ansichten (letzte 30 Tage)
For example
A=[ 1 3 1 1 2 3 5]

Akzeptierte Antwort

Torsten
Torsten am 23 Okt. 2018
Bearbeitet: Torsten am 23 Okt. 2018
[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.
  2 Kommentare
IBM watson
IBM watson am 23 Okt. 2018
Bearbeitet: IBM watson am 23 Okt. 2018
Actually i want to use your code for this:
https://www.mathworks.com/matlabcentral/answers/425580-setdiff-comand-usage?s_tid=mlc_ans_email_view#answer_342895

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating 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!

Translated by