This is a static copy of a profile report

Home

Koch_Kurve>koch (Calls: 5, Time: 10.791 s)
Generated 18-May-2021 16:05:24 using performance time.
subfunction in file /home/wolf/MATLAB Add-Ons/Toolboxes/FraktaleTB/Koch_Kurve.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
Koch_Kurvefunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
38
segment(b)=mod(m,4);
461375722.919 s27.1%
42
end
461375721.747 s16.2%
39
m=floor(m/4);
461375721.721 s15.9%
41
ang=ang+angle(r);
461375721.689 s15.7%
40
r=segment(b)+1;
461375721.682 s15.6%
All other lines  1.033 s9.6%
Totals  10.791 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
newplotwrapperfunction50.077 s0.7%
xlimfunction50.021 s0.2%
ylimfunction50.005 s0.0%
Self time (built-ins, overhead, etc.)  10.688 s99.0%
Totals  10.791 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function25
Non-code lines (comments, blank lines)4
Code lines (lines that can run)21
Code lines that did run21
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
  25 
function koch(k)
  26 

  27 
%k=2;        
< 0.001 
      5 
  28
mmax=4^k; 
< 0.001 
      5 
  29
x=zeros(1,mmax); 
< 0.001 
      5 
  30
y=zeros(1,mmax); 
< 0.001 
      5 
  31
h=3^(-k); 
< 0.001 
      5 
  32
x(1)=0;y(1)=0; 
< 0.001 
      5 
  33
angle(1)=0;angle(2)=pi/3;angle(3)=-pi/3;angle(4)=0; 
< 0.001 
      5 
  34
segment = zeros(k); 
< 0.001 
      5 
  35
for a=1:mmax 
  0.140 
4194389 
  36
    m=a-1;ang=0; 
  0.159 
4194389 
  37
    for b=1:k 
  2.919 
46137572 
  38
        segment(b)=mod(m,4); 
  1.721 
46137572 
  39
        m=floor(m/4); 
  1.682 
46137572 
  40
        r=segment(b)+1; 
  1.689 
46137572 
  41
        ang=ang+angle(r); 
  1.747 
46137572 
  42
    end 
  0.245 
4194389 
  43
    x(a+1)=x(a)+h*cos(ang); 
  0.214 
4194389 
  44
    y(a+1)=y(a)+h*sin(ang); 
  0.148 
4194389 
  45
end 
  46 

  0.097 
      5 
  47
plot(x,y,'b'); 
  0.022 
      5 
  48
xlim([0, 1]) 
  0.006 
      5 
  49
ylim([-0.02 0.3]) 

Other subfunctions in this file are not included in this listing.