Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!w35g2000yqm.googlegroups.com!not-for-mail
From: wapo <apostolos1975@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Counting elements in a matrix
Date: Tue, 17 Feb 2009 00:12:30 -0800 (PST)
Organization: http://groups.google.com
Lines: 29
Message-ID: <bab8efdd-c517-49b6-8695-0527e709c063@w35g2000yqm.googlegroups.com>
References: <gndr1j$6th$1@fred.mathworks.com>
NNTP-Posting-Host: 194.237.142.10
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1234858350 2595 127.0.0.1 (17 Feb 2009 08:12:30 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 17 Feb 2009 08:12:30 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: w35g2000yqm.googlegroups.com; posting-host=194.237.142.10; 
	posting-account=_qj5vQoAAAA15xvjUBwpCIwWln4nYPTM
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) 
	Gecko/2009011913 Firefox/3.0.6,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:518766

On Feb 17, 9:04=A0am, "Raghavasimhan Thirunarayanan"
<kingmakerb...@rediffmail.com> wrote:
> Hi all,
> =A0I would like to know whether it is possible to list all the elements i=
n an arbitrary matrix and the number of times they appear. For example if m=
y matrix is
> [ 1,2,3; 3,4,5; 5,6,7]
> the program should list as follows
> element =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 no of appearances
> =A0 =A0 1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A01
> =A0 =A0 2 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A01
> =A0 =A0 3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A02
> =A0 =A0 4 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A01
> =A0 =A0 5 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A02
> =A0 =A0 6 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A01
> =A0 =A0 7 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A01.
>
> I would much appreciate if anyone can help regarding this.
>
> Thanks in advance

If m is your matrix then hist(m(:))