how to draw circles with different radii

4 ビュー (過去 30 日間)
Mary
Mary 2013 年 6 月 4 日
Hi all
I am new to matlab. I want to draw circles with x and y-coordinates stored in X-matrix and Y-matrix with radius stored in R matrix. I want to draw all the circles in the same plot with colour green. Can anyone help me? Your help is highly appreciated

回答 (2 件)

Iman Ansari
Iman Ansari 2013 年 6 月 4 日
n=10;
X=rand(n,1)*10;
Y=rand(n,1)*10;
R=rand(n,1)*3;
P=[0:0.1:2*pi 0];
xr=R*cos(P);
yr=R*sin(P);
X_C=bsxfun(@plus,X,xr);
Y_C=bsxfun(@plus,Y,yr);
plot(X_C',Y_C','g')
axis equal

Image Analyst
Image Analyst 2013 年 6 月 4 日

カテゴリ

Help Center および File ExchangeDenoising and Compression についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by