Hilbert Curve

How to draw the famous Hilbert curve, the curve that fills an area.

You are now following this Submission

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://www.mathworks.com/matlabcentral/fileexchange/4646-hilbert-curve), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Fractals in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0

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