Reputation: 35
What would be the program code for drawing five circles in random positions in MATLAB?
Upvotes: 1
Views: 2259
Reputation: 19870
You can do it simply with SCATTER or PLOT function using RAND to generate random X and Y coordinates.
scatter(rand(5,1),rand(5,1))
You can draw circle also using famous CIRCLE function from the File Exchange.
Upvotes: 3
Reputation: 9857
Try these two functions together:
http://www.mathworks.com/help/toolbox/pde/ug/pdecirc.html
http://www.mathworks.com/help/techdoc/ref/rand.html
Upvotes: 0