SHARE
TWEET

Untitled

a guest Jun 3rd, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function cantr=cantor(l,a,x)
  2.   if nargin <1
  3.     tic
  4.     l=0;
  5.     N=1E7;
  6.     cantr=ones(1,N);
  7.   else
  8.     cantr=a;
  9.     l=l+1;
  10.   endif
  11.   if l==14
  12.       return
  13.   endif
  14.   n=length(cantr);
  15.   cantr(ceil(n/3)+1:2*ceil(n/3))=0;
  16.   cantr(1:ceil(n/3))=cantor(l,cantr(1:ceil(n/3)));
  17.   cantr(2*ceil(n/3)+1:end)=cantor(l,cantr(2*ceil(n/3)+1:end));
  18.   if 1==0
  19.     subplot (2,1,1)
  20.     plot(cantr);
  21.     imcan=zeros(1,length(cantr));
  22.     for i=2:length(cantr)
  23.       if cantr(i)
  24.         imcan(i)=imcan(i-1)+dy;
  25.       else
  26.         imcan(i)=imcan(i-1);
  27.       end
  28.     end
  29.     subplot (2,1,2)
  30.     plot (imcan)
  31.     toc
  32.  endif
  33.  endfunction
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top