display fix radius circles
4 views (last 30 days)
Show older comments
I wanna to put fix radius circles at (0,1),(1,1),(2,1),(3,1) with diameter of 1 at same time. Is there any way can achieve this?
2 Comments
dpb
on 10 Aug 2021
function hL = circle(x0,y0,r)
th = 0:pi/100:2*pi;
x = r * cos(th) + x0;
y = r * sin(th) + y0;
hL=plot(x,y);
end
is a most rudimentary illustration of generating the circle cartesian coordinates...
Answers (1)
Sivani Pentapati
on 4 Aug 2021
Refer to the below code for your usecase:
viscircles([0,1;1,1;2,1;3,1],0.5*ones(4,1))
where you pass in an array, with center co-ordinates, (0,1),(1,1),(2,1),(3,1) as the first argument and radii, 0.5 as the second argument
1 Comment
dpb
on 9 Aug 2021
NB: visicircles is in Image Processing Toolbox, not base MATLAB.
Which is fine for those who have the TB, not so much if don't.
See Also
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!