File Exchange

image thumbnail

FiledCircle

version 1.0.0.0 (1.72 KB) by Silvano Bertoldo
This function create a matrix with a filled circle.

0 Downloads

Updated 05 May 2011

View License

This function create a matrix containing a filled circle. The circle has center in points specified in vector vCenter (represented as [x y]) and radius specified by nRadius.

Cite As

Silvano Bertoldo (2021). FiledCircle (https://www.mathworks.com/matlabcentral/fileexchange/31323-filedcircle), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Jan

Instead of two slow loops the complete computation can be vectorized:
x = 1:2*nRadius;
y = transpose(x);
mMatCircle = bsxfun(@plus, (x - vCenter(1))^2, (y - vCenter(2))^2) < (radius^2);
The function is well documented, but the style differs from the standard of Matlab's toolbox functions such that "help FilledCircle" is not really helpful. Although I love Italian, English comments would be better.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!