Recursion for Sierpinski Triangle
Version 1.0 (1.46 KB) by
Trong Hoang Vo
This function draws Sierpinski triangle by using recursion
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 LinuxCategories
Find more on Genomics and Next Generation Sequencing in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
RST/
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0 |
|
