So I've been having trouble making the results inside the circe green and the ones outside the circle blue. The results under 1 and inside the radius of the circle should color diferent of the ones bigger than 1.
this is where I am so far:
n=1000;u=rand(1,n);v=rand(1,n);x=2*u-1;y=2*v-1;d2=x.^2+y.^2;d=d2.^0.5;nc=0;t=0;u=0;r=1;th=0:pi/100:2*piX=r*cos(pi)+t;Y=r*sin(pi)+u;for i=1:n if d(i)<=1 nc=nc+1; endendnewpi=4*nc/nplot(a,b,'red');hold onscatter(x,y,'.')
Any help on how to color code different results on a scatter plot?
help would be very appreciated!
Best Answer