Ahojte, skúšala som v Matlabe spustiť nasledovný kód, ktorý by mal vykresliť sierpinskeho fraktál (L-systémy) pri 45 stupňoch, ale vyhadzuje mi to chybu...neviete poradiť čo by som mala zmeniť?
~~function z = sierpinski(n)
%SIERPINSKI Sierpinski Cross Curve
% Z = SIERPINSKI(N) is a closed curve in the complex plane
% with 4^(N+1)+1 points. N is a nonnegative integer.
%
% % Example
plot(sierpinski(4)), axis equal
% Constants
a = 1 + 1i;
b = 1 - 1i;
c = 2 - sqrt(2);
% Generate point sequence
z = c;
for k = 1:n
w = 1i*z;
z = [z+b; w+b; a-w; z+a]/2;
end
% Close cross
z = [z; 1i*z; -z; -1i*z; z(1)];
function z = sierpinski(n)
%SIERPINSKI Sierpinski Cross Curve
% Z = SIERPINSKI(N) is a closed curve in the complex plane
% with 4^(N+1)+1 points. N is a nonnegative integer.
%
% % Example
plot(sierpinski(4)), axis equal
% Constants
a = 1 + 1i;
b = 1 - 1i;
c = 2 - sqrt(2);
% Generate point sequence
z = c;
for k = 1:n
w = 1i*z;
z = [z+b; w+b; a-w; z+a]/2;
end
% Close cross
z = [z; 1i*z; -z; -1i*z; z(1)];