How can I count the number of elements which are distributed randomly in each region (MATLAB)? -
in work, matlab,i tried distribute n points randomly in circle. divide field in regions (= divided circle segments angle alpha). count number of elements in each regions. know please how count number of elements in each piece of pie??
use polar coordinates point, convert them [theta,roh] = cart2pol(x,y)
.
roh distrance origin, use a=(roh>2.7)+(roh>5.2)
0 first radios, 1 second , 2 third. theta
it's same trick. b=(theta>pi/6)+(theta>pi/3)
now can points a==0&&b==0
small segment next x-axis.
Comments
Post a Comment