Anonymous user
Sierpinski triangle/Graphical: Difference between revisions
m
→{{header|MATLAB}}
(add MATLAB) |
|||
Line 963:
=={{header|MATLAB}}==
===Basic Version===
<lang MATLAB>[x, x0] = deal(cat(3, [1 0]', [-1 0]', [0 sqrt(3)]'));
Line 970 ⟶ 969:
end
patch('Faces', reshape(1 : 3 * 3 ^ k, 3, '')', 'Vertices', x(:,:)')</lang>
{{out}}
Fail to upload output image, use the one of PostScript:
[[File:Sierpinski-PS.png]]
===Bit Operator Version===
<lang MATLAB>t = 0 : 2^16 - 1;
|