This is a static copy of a profile reportHome
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 Name | Function Type | Calls |
| Koch_Kurve | function | 5 |
Lines where the most time was spent
| Line Number | Code | Calls | Total Time | % Time | Time Plot |
| 38 | segment(b)=mod(m,4); | 46137572 | 2.919 s | 27.1% |  |
| 42 | end | 46137572 | 1.747 s | 16.2% |  |
| 39 | m=floor(m/4); | 46137572 | 1.721 s | 15.9% |  |
| 41 | ang=ang+angle(r); | 46137572 | 1.689 s | 15.7% |  |
| 40 | r=segment(b)+1; | 46137572 | 1.682 s | 15.6% |  |
| All other lines | | | 1.033 s | 9.6% |  |
| Totals | | | 10.791 s | 100% | |
Children (called functions)
| Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
| newplotwrapper | function | 5 | 0.077 s | 0.7% |  |
| xlim | function | 5 | 0.021 s | 0.2% |  |
| ylim | function | 5 | 0.005 s | 0.0% |  |
| Self time (built-ins, overhead, etc.) | | | 10.688 s | 99.0% |  |
| Totals | | | 10.791 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
Show coverage for parent directory
| Total lines in function | 25 |
| Non-code lines (comments, blank lines) | 4 |
| Code lines (lines that can run) | 21 |
| Code lines that did run | 21 |
| Code lines that did not run | 0 |
| 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.