This is a static copy of a profile reportHome
cart2pol (1721 calls, 0.040 sec)
Generated 05-Nov-2014 07:53:25 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/matlab/specfun/cart2pol.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
tp_surfmap | function | 1721 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
23 | r = hypot(x,y); | 1721 | 0.020 s | 50.0% |  |
22 | th = atan2(y,x); | 1721 | 0.020 s | 50.0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.040 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) | 21 |
Code lines (lines that can run) | 2 |
Code lines that did run | 2 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function [th,r,z] = cart2pol(x,y,z)
2 %CART2POL Transform Cartesian to polar coordinates.
3 % [TH,R] = CART2POL(X,Y) transforms corresponding elements of data
4 % stored in Cartesian coordinates X,Y to polar coordinates (angle TH
5 % and radius R). The arrays X and Y must be the same size (or
6 % either can be scalar). TH is returned in radians.
7 %
8 % [TH,R,Z] = CART2POL(X,Y,Z) transforms corresponding elements of
9 % data stored in Cartesian coordinates X,Y,Z to cylindrical
10 % coordinates (angle TH, radius R, and height Z). The arrays X,Y,
11 % and Z must be the same size (or any of them can be scalar). TH is
12 % returned in radians.
13 %
14 % Class support for inputs X,Y,Z:
15 % float: double, single
16 %
17 % See also CART2SPH, SPH2CART, POL2CART.
18
19 % Copyright 1984-2005 The MathWorks, Inc.
20 % $Revision: 5.10.4.2 $ $Date: 2005/05/31 16:31:20 $
21
0.02 1721 22 th = atan2(y,x);
0.02 1721 23 r = hypot(x,y);