Path: news.mathworks.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!news.mathforum.org!not-for-mail
From: juckou <ja79@hw.ac.uk>
Newsgroups: comp.soft-sys.matlab
Subject: How to find elements of a given value in a matrix?
Date: Thu, 25 Dec 2008 13:56:52 EST
Organization: The Math Forum
Lines: 8
Message-ID: <16525645.1230231468100.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1230231468 455 144.118.30.135 (25 Dec 2008 18:57:48 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Thu, 25 Dec 2008 18:57:48 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:508761


Dear all,

I'm just trying to know how many elements in a matrix have a given value. I mean, if I have a matrix A=[1 2 3; 1 2 3; 1 2 3] I want to know the number (or the percentage) of elements that are "1" (3 or the 33,3% in this case).

Any help?
Thank you very much

julio