How to draw a white circle ?
13 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I would like to draw a white circle in a black square in Matlab but I don't have any idea how to do it. Would you please explain me how to do it ?
In advance, thank you !
0 件のコメント
採用された回答
Azzi Abdelmalek
2012 年 10 月 29 日
編集済み: Azzi Abdelmalek
2012 年 10 月 29 日
r=4; %radius
x0=0;y0=0; % circle center coordinates
x=x0-r:0.01:x0+r
y=sqrt(r^2-(x-x0).^2)+y0;
fill([x0-r x0+r x0+r x0-r ],[y0-r y0-r y0+r y0+r ],'k')
hold on;
plot(x,y,'w',x,-y,'w');
axis square
axis([x0-2*r x0+2*r y0-2*r y0+2*r]) % facultative
3 件のコメント
Azzi Abdelmalek
2012 年 10 月 29 日
x=x0-r:0.01:x0+r
is a vector of points we are using to plot your circle
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!