Hilbert Curve

How to draw the famous Hilbert curve, the curve that fills an area.
7.1K Downloads
Updated 9 Apr 2004

View License

This recursive function calculates coordinates of n-th order Hilbert curve. It is then possible to plot it using the "line" command.

Cite As

Federico Forte (2026). Hilbert Curve (https://se.mathworks.com/matlabcentral/fileexchange/4646-hilbert-curve), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Fractals in Help Center and MATLAB Answers
Version Published Release Notes
1.0.0.0

Modified "Peano curve" in more correct "Hilbert curve".