This is a static copy of a profile report

Home

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)

Function NameFunction TypeCalls
calcSourceDistfunction3
flagRFI_posfunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
19
[x1,y1,z1]=sph2cart(az1,el1,1)...
50.503 s36.2%
20
[x2,y2,z2]=sph2cart(az2,el2,1)...
50.492 s35.4%
22
sa=acos(x1.*x2+y1.*y2+z1.*z2);
50.208 s15.0%
25
sa=sa/d2r;
50.077 s5.5%
16
el1=el1*d2r; el2=el2*d2r;
50.044 s3.1%
All other lines  0.066 s4.7%
Totals  1.388 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
sph2cartfunction100.995 s71.7%
Self time (built-ins, overhead, etc.)  0.393 s28.3%
Totals  1.388 s100% 
Code Analyzer results
Line numberMessage
9EXIST with two input arguments is generally faster and clearer than with one input argument.
Coverage results
[ Show coverage for parent directory ]
Total lines in function26
Non-code lines (comments, blank lines)12
Code lines (lines that can run)14
Code lines that did run12
Code lines that did not run2
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.