开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜