필터 지우기
필터 지우기

find simlar number in array

조회 수: 2 (최근 30일)
Mohammed
Mohammed 2012년 11월 9일
if i have a big array (ex: 4x58) and there are some simalr numbers on it. i want to find how many each number on the array has been repeted. how can matlab help me on that? could you explain step by step please?
  댓글 수: 1
Matt Kindig
Matt Kindig 2012년 11월 9일
편집: Matt Kindig 2012년 11월 9일
Do you mean similar numbers (as in within a certain threshold apart) or identical numbers? If identical, you can use the hist() function.
doc hist

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

답변 (1개)

Matt Fig
Matt Fig 2012년 11월 9일
편집: Matt Fig 2012년 11월 9일
Similar or identical? Those are different! .5 is similar to .6, but not identical.
If you mean identical, you can count how many times each number occurs like this:
A = randi(30,5,5)
N = unique(A(:));
N(:,2) = histc(A(:),N)
  댓글 수: 2
Mohammed
Mohammed 2012년 11월 9일
i mean identical sir.
can you tell me how can i use hist?
José-Luis
José-Luis 2012년 11월 9일
The documentation is usually a good place to start.
doc histc

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

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by