display fix radius circles

4 views (last 30 days)
Jordan
Jordan on 29 Jul 2021
Commented: dpb on 10 Aug 2021
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
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...

Sign in to comment.

Answers (1)

Sivani Pentapati
Sivani Pentapati on 4 Aug 2021
As per my knowledge, you can use the viscricles function to plot 4 circles at the same time
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
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.

Sign in to comment.

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!