%generate random numbers
%centers of circle
x = rand(100,1);y = rand(100,1);centers = [x y];radii = 0.05.*ones(length(x),1);% %clear the axis
cla% %fix the axis limits
xlim([0 1])ylim([0 1])% %set the axis aspect ratio to 1:1
axis squarebox on%display the circles
viscircles(centers,radii, 'Color','k');for i = 1:1:length(x) if x(i) >= 0.9 x(i) =[]; y(i) =[]; endend%This is not working, though the circles are plotting well
MATLAB: Hello, I am trying to plot circles and then get rid of the circles touching the axis as shown when you run the code. After this, I am trying to find the distance between these circles so as to know the circle that is farthest from the rest. THANKS
distancespercolation
Related Question
- I need x,y coordinates which are randomly generated between 1 to 400 for x coordinates and 1 to 100 for y coordinates, condition is minimum distance between coordinates is 10 and maximum distance is 20, distances should vary from 10 to 20? plz help
- Plotting circles
- Wrap and center justify axes and tick label
- Circle-Circle Intersection ,dimension between circles
- Viscircles. Example doesn’t work
- Circle fitting
Best Answer