필터 지우기
필터 지우기

How to know the quatity of the number in an array

조회 수: 1 (최근 30일)
uncung fgv
uncung fgv 2013년 5월 16일
my data is:
A=[1 1 2 1 1 1 2 1 1 1 3 3 3 1 1 3 4 1 2 1 2 2 1 1 1 1 3 2 2 3 1 7 1 1 1 1 3 1 1 5 2 1 1 1 1 1 1 1 1 1 1 1 4 1 1 2 2 1 2 4 3 4 1 1 2 2 2 1 1 1 1 2 2 3 1 2 2 1 2 2 3 3 3 2 1 2 1 3 3 4 2 1 1 4 1 1 2 1 1 3 1 2 2 1 1 1 1 1 3 3 2 1 3 2 1 2 1 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 1 2 1 1 1 1 1 1 1 1 1 3 2 2 1 1 2 1 1 1 1 1 1 1 2 3 3 2 2 1 1 2 1 1 4 1 1 2 3 1 3 1 1 1 2 2 3 1 2 1 1 3 1 1 2 2 1 ]
I want to know how many times or the quantity of number 1 in my array.
thank you.
  댓글 수: 1
uncung fgv
uncung fgv 2013년 5월 16일
am I missing this question?
I dont know exactly in english.
I want to know how many times the 1, or 2, or 3 ... is mentioned in that array.

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 16일
out=sum(A(A==1))
  댓글 수: 7
uncung fgv
uncung fgv 2013년 5월 16일
actually I want:
how many times alphabet/number/character 2 is mentioned in that array.
not the sum/amount.
uncung fgv
uncung fgv 2013년 5월 16일
yes, thank you. sean de wolski. your answer is hidden.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by