필터 지우기
필터 지우기

How to count tha maximum frequency of an element in a matrix/ array?

조회 수: 2 (최근 30일)
aya qassim
aya qassim 2019년 1월 7일
댓글: aya qassim 2019년 1월 7일
for example if I have an array
x=[1,3,4,2,2,1,1,1,1]
I want to know what is the frequency of each element in the array.
thank you,
  댓글 수: 2
madhan ravi
madhan ravi 2019년 1월 7일
you haven’t responded to the previous question , is it similar?
aya qassim
aya qassim 2019년 1월 7일
Sorry,I did not notice that you have answered.
I will see now.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2019년 1월 7일
x=[1,3,4,2,2,1,1,1,1] ;
[c,ia,ib] = unique(x) ;
h = hist(ib) ;
[c' h(h>0)']

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by