Recursion for Sierpinski Triangle

This function draws Sierpinski triangle by using recursion
147 Downloads
Updated 14 Apr 2016

View License

RST.m: Recursion for Sierpinski Triangle
Description: This function draws Sierpinski triangle by using recursion
Input: 3 coordinates A, B, C (2-D vector) and number of recursion 'n'

Example: A(2,4), B(0,0), C(4,0), n = 5 --> RST(A, B, C, n)

Output: Graph of Sierpinski Triangle

Complexity: O(3^n)

---------------------------------------------
main.m: Example for using RST.m

Cite As

Trong Hoang Vo (2025). Recursion for Sierpinski Triangle (https://se.mathworks.com/matlabcentral/fileexchange/56551-recursion-for-sierpinski-triangle), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Genomics and Next Generation Sequencing 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
1.0