Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: counting dots
Date: Sun, 18 Jan 2009 06:35:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <gkuiim$t29$1@fred.mathworks.com>
References: <gkug9i$2b4$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232260502 29769 172.30.248.37 (18 Jan 2009 06:35:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 18 Jan 2009 06:35:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:512282


"Freda " <fredawerdiger@hotmail.com> wrote in message <gkug9i$2b4$1@fred.mathworks.com>...
> Take this plot of complex numbers:
> 
> one=rand(128);
> two=rand(128).*pi;
> comp=one.*exp(i.*two);
> re=real(comp);
> im=imag(comp);
> plot(re,im,'k.','MarkerSize',4)
> 
> How do i find out the number of dots in a given section?
> ie, counting dots.

Hello Freda,

You can easily filter the vector comp with respect to the given section so as to give the number of points in that section. But the section should clearly be defined.

As an example, if the section will be "Those points whose magnitudes are less than 0.5", you can even filter the vector one rather than comp. So the number of points in that section would be: length(sum(one<0.5)).

Hope this helps.