📄 cantor3.m
字号:
function Cantor3(n);
% n is the number of recursion
%
% \copyright:zjliu
% Author's email: zjliu2001@163.com
if nargin==0;
n=5;
end
hold on;
[x,L]=ccp(0,0.5,n,0);
axis off;
function [x,L]=ccp(x,L,n,y);
plot([x-L,x+L],[y,y],'k','linewidth',2);
if n>1;
[x,L]=ccp(x-L/1.5,L/3,n-1,y-1);
L=L*3;x=x+L/1.5;
[x,L]=ccp(x+L/1.5,L/3,n-1,y-1);
L=L*3;x=x-L/1.5;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -