for n =1:Nfor radius = 1:R % Random x & y numbers.
theta = rand(1,n)*(2*pi);r = sqrt(rand(1,n))*radius;endx(n)= x1 + r.*cos(theta);y(n)= y1 + r.*sin(theta);endplot(x,y,'.')
i am creating a random plot inside a circle using for command. i am having an error:
??? In an assignment A(I) = B, the number of elements in B and I must be the same.Error in ==> Q11 at 53x(n)= x1 + r.*cos(theta);
how can i overcome this?
Best Answer