File Exchange

image thumbnail

Sierpinski triangle (2D, 3D, any triangle shape)

version 1.3 (59.5 KB) by Nicolas Douillet
Function to compute, display, and save a Sierpinski triangle defined by three given points of the 2D or 3D space, at any iteration number.


Updated 26 Aug 2020

View Version History

View License

Please check the examples tab (doc) here on the right for a complete description.

Once downloaded, typewrite 'doc Sierpinski_triangle' or 'help Sierpinski_triangle' in Matlab console for support.

For 2D point inputs, just padd the point Z coordinate with a zero (see example #2)

Cite As

Nicolas Douillet (2020). Sierpinski triangle (2D, 3D, any triangle shape) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Nicolas Douillet

Default maximum number of iterations (nb_max_it) set to 9. Increase it line 125.

MATLAB Release Compatibility
Created with R2019b
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!