Hilbert Curve
Show older comments
Hi I'm trying to plot this:
function [x,y]=hilbert(n);
%HILBERT Hilbert curve.
%
% [x,y]=hilbert(n) gives the vector coordinates of points
% in n-th order Hilbert curve of area 1.
%
% Example: plot of 5-th order curve
%
% [x,y]=hilbert(5);line(x,y)
n=5
if n<=0
x=0;
y=0;
else
[xo,yo]=hilbert(n-1);
x=.5*[-.5+yo -.5+xo .5+xo .5-yo];
y=.5*[-.5+xo .5+yo .5+yo -.5-xo];
end
However I get this error message
??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer.
Error in ==> hilbert
Anyone know how to fix this?
Everyone on the page the file is posted on says it works well but sadly I cannot get it to run.
1 Comment
Sean de Wolski
on 11 Mar 2011
What did you call it with? Did you insert the overwriting of the input argument n, with n=5
?
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!