Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Count the number occurence
Date: Thu, 4 Nov 2010 18:00:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <iausb8$ic8$1@fred.mathworks.com>
References: <iaubs8$399$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1288893608 18824 172.30.248.37 (4 Nov 2010 18:00:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 4 Nov 2010 18:00:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:683956

"Alex " <alaios@yahoo.com> wrote in message <iaubs8$399$1@fred.mathworks.com>...
> ...... and I would like to count how many times every number appears. ......
- - - - - - - - - - 
  If your data values are not necessarily integers, you can first do

 [~,~,n] = unique(data)

and then use histc on the returned vector n to get your counts.

Roger Stafford