Writing a Matlab function to plot circles with random parameters

  • Context: MATLAB 
  • Thread starter Thread starter gr33ndem0n
  • Start date Start date
  • Tags Tags
    Idea Matlab No idea
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
gr33ndem0n
Messages
1
Reaction score
0
Write a Matlab function mycirc(c,r) that will plot the circle whose center is at c[x0,y0] and whose radius is r. Then plot 100 random circles with c,r chosen randomly from the interval 0 to 1.
 
Physics news on Phys.org
There are several ways to do this. One is to use the parametric equation for circle (think radius and iteration over angle), another is to use the rectangle command's curvature argument. Look up rand in help to see how you might choose c & r. Look up the for or while loops to see how you might create any given number of such circles.