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.
Silvano Bertoldo (2021). FiledCircle (https://www.mathworks.com/matlabcentral/fileexchange/31323-filedcircle), MATLAB Central File Exchange. Retrieved .
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.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!