File Exchange

image thumbnail


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


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 (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)


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!