Fractal analysis package

This is a set of functions to analyse the geometry of particle aggregates in black and white binary images.
Updated 21 Nov 2022

View License

This package contains 3 main finder functions:
ap_finder.m - this determines the area and perimeters of particle clusters in a binary image, and returns each in a separate array. Mainly for making area vs. perimeter plots for fractal particle aggregates. Note, the perimeter is determined by expanding the clusters by 1 pixel in every direction, not by the default MATLAB routine.
conn_finder.m - this function determines several geometric aspects of the connected components of the image (i.e. the clusters), such as average cluster area, centre of mass coordinates for each cluster, the gyration radius of each cluster, and the correlation length of the image.
D_finder.m - find the Hausdorff fractal dimension of each cluster in the image, using the scaling/box counting method.
A short mathematical note is included on the methods used.
For practial examples of use of this code, see:
[1.] Frydendahl, Christian, Meir Grajower, Jonathan Bar-David, Roy Zektzer, Noa Mazurski, Joseph Shappir, and Uriel Levy. "Giant enhancement of silicon plasmonic shortwave infrared photodetection using nanoscale self-organized metallic films." Optica 7, no. 5 (2020): 371-379. - supplementary materials.
[2.] Zuliani, Alessio, David Chelazzi, Rosangela Mastrangelo, Rodorico Giorgi, and Piero Baglioni. "Adsorption kinetics of acetic acid into ZnO/castor oil-derived polyurethanes." Journal of Colloid and Interface Science (2022).

Cite As

Christian Frydendahl (2024). Fractal analysis package (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Fractals in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Added additional practical example reference.


Added reference for a practical implementation of the code.


Added option for including or excluding the particles touching the edges of a binary image.