How can I plot circles of different diameters within a square?

I need help to create code which will generate circles of different diameters within a square geometry. The circles cannot overlap. I am an amateur at using Matlab and any ideas will be greatly appreciated.

 채택된 답변

Kevin Claytor
Kevin Claytor 2012년 7월 17일

0 개 추천

댓글 수: 3

I tried running thr program but the following comments are returned. What am I doing wrong?
function ptRads = growbubbles(ptsIn)
|
Error: Function definitions are not permitted in this context.
This error often occurs when functions are used as scripts. You'll want to save the function as a .m file with the same name (growbubbles.m), then you call it from the command window / your scripts with;
ptrads = growbubbles(ptsIn)
That is, you don't need the 'function' keyword when calling functions from the command window / scripts. It is used to declare a .m file as a function rather than a script.
thank you very much!! i got it to work. Could you please explain what is the distance map? What exactly does the distance map give you? Is it the distances between the randomly generated points?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

2012년 7월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by