This is a static copy of a profile reportHome
spaceangle (5 calls, 1.388 sec)
Generated 05-Aug-2011 13:01:31 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/angles/spaceangle.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
19 | [x1,y1,z1]=sph2cart(az1,el1,1)... | 5 | 0.503 s | 36.2% |  |
20 | [x2,y2,z2]=sph2cart(az2,el2,1)... | 5 | 0.492 s | 35.4% |  |
22 | sa=acos(x1.*x2+y1.*y2+z1.*z2); | 5 | 0.208 s | 15.0% |  |
25 | sa=sa/d2r; | 5 | 0.077 s | 5.5% |  |
16 | el1=el1*d2r; el2=el2*d2r; | 5 | 0.044 s | 3.1% |  |
All other lines | | | 0.066 s | 4.7% |  |
Totals | | | 1.388 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
sph2cart | function | 10 | 0.995 s | 71.7% |  |
Self time (built-ins, overhead, etc.) | | | 0.393 s | 28.3% |  |
Totals | | | 1.388 s | 100% | |
Code Analyzer results
Line number | Message |
9 | EXIST with two input arguments is generally faster and clearer than with one input argument. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 26 |
Non-code lines (comments, blank lines) | 12 |
Code lines (lines that can run) | 14 |
Code lines that did run | 12 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 85.71 % |
Function listing
time calls line
1 function sa=spaceangle(az1,el1,az2,el2,units)
2 % sa=spaceangle(az1,el1,az2,el2,units)
3 %
4 % Calculate the space angle between vectors az1,el1 and az2,el2
5 %
6 % If optional parameter units is 'deg' inputs and outputs in
7 % degrees. Otherwise radians
8
0.01 5 9 if(~exist('units'))
10 units='rad';
11 end
12
5 13 if(strcmp(units,'deg'))
5 14 d2r=pi/180;
0.02 5 15 az1=az1*d2r; az2=az2*d2r;
0.04 5 16 el1=el1*d2r; el2=el2*d2r;
5 17 end
18
0.50 5 19 [x1,y1,z1]=sph2cart(az1,el1,1);
0.49 5 20 [x2,y2,z2]=sph2cart(az2,el2,1);
21
0.21 5 22 sa=acos(x1.*x2+y1.*y2+z1.*z2);
23
5 24 if(strcmp(units,'deg'))
0.08 5 25 sa=sa/d2r;
5 26 end
Other subfunctions in this file are not included in this listing.