This is a static copy of a profile reportHome
sph2cart (15 calls, 1.552 sec)
Generated 05-Aug-2011 13:01:31 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/specfun/sph2cart.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 |
22 | x = rcoselev .* cos(az); | 15 | 0.426 s | 27.5% |  |
23 | y = rcoselev .* sin(az); | 15 | 0.404 s | 26.1% |  |
21 | rcoselev = r .* cos(elev); | 15 | 0.372 s | 23.9% |  |
20 | z = r .* sin(elev); | 15 | 0.339 s | 21.8% |  |
All other lines | | | 0.011 s | 0.7% |  |
Totals | | | 1.552 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 23 |
Non-code lines (comments, blank lines) | 19 |
Code lines (lines that can run) | 4 |
Code lines that did run | 4 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function [x,y,z] = sph2cart(az,elev,r)
2 %SPH2CART Transform spherical to Cartesian coordinates.
3 % [X,Y,Z] = SPH2CART(TH,PHI,R) transforms corresponding elements of
4 % data stored in spherical coordinates (azimuth TH, elevation PHI,
5 % radius R) to Cartesian coordinates X,Y,Z. The arrays TH, PHI, and
6 % R must be the same size (or any of them can be scalar). TH and
7 % PHI must be 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 TH,PHI,R:
13 % float: double, single
14 %
15 % See also CART2SPH, CART2POL, POL2CART.
16
17 % Copyright 1984-2005 The MathWorks, Inc.
18 % $Revision: 5.12.4.2 $ $Date: 2005/05/31 16:31:22 $
19
0.34 15 20 z = r .* sin(elev);
0.37 15 21 rcoselev = r .* cos(elev);
0.43 15 22 x = rcoselev .* cos(az);
0.40 15 23 y = rcoselev .* sin(az);