This is a static copy of a profile report

Home

cart2sph (5 calls, 0.809 sec)
Generated 05-Aug-2011 13:01:32 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/specfun/cart2sph.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
pointing_modelfunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
23
az = atan2(y,x);
50.251 s31.1%
22
elev = atan2(z,hypotxy);
50.208 s25.7%
20
hypotxy = hypot(x,y);
50.186 s23.0%
21
r = hypot(hypotxy,z);
50.164 s20.3%
All other lines  0 s0%
Totals  0.809 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function23
Non-code lines (comments, blank lines)19
Code lines (lines that can run)4
Code lines that did run4
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function [az,elev,r] = cart2sph(x,y,z)
2 %CART2SPH Transform Cartesian to spherical coordinates.
3 % [TH,PHI,R] = CART2SPH(X,Y,Z) transforms corresponding elements of
4 % data stored in Cartesian coordinates X,Y,Z to spherical
5 % coordinates (azimuth TH, elevation PHI, and radius R). The arrays
6 % X,Y, and Z must be the same size (or any of them can be scalar).
7 % TH and PHI are returned in radians.
8 %
9 % TH is the counterclockwise angle in the xy plane measured from the
10 % positive x axis. PHI is the elevation angle from the xy plane.
11 %
12 % Class support for inputs X,Y,Z:
13 % float: double, single
14 %
15 % See also CART2POL, SPH2CART, POL2CART.
16
17 % Copyright 1984-2005 The MathWorks, Inc.
18 % $Revision: 5.12.4.2 $ $Date: 2005/05/31 16:31:21 $
19
0.19 5 20 hypotxy = hypot(x,y);
0.16 5 21 r = hypot(hypotxy,z);
0.21 5 22 elev = atan2(z,hypotxy);
0.25 5 23 az = atan2(y,x);