How do you draw circles in random locations in MATLAB
What would be the program code for drawing five circles in random posi开发者_如何学Gotions in MATLAB?
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.
Try these two functions together:
http://www.mathworks.com/help/toolbox/pde/ug/pdecirc.html
http://www.mathworks.com/help/techdoc/ref/rand.html
精彩评论