This is a static copy of a profile reportHome
cosined (2 calls, 0.678 sec)
Generated 05-Aug-2011 13:03:56 using cpu time.
function in file /home/LeechJ/cbass_analysis/pointing/cosined.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
coco | function | 2 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
28 | Res(:,1) = atan2(L2,L1); ... | 1 | 0.208 s | 30.6% |  |
32 | Res(In0,2) = atan(L3(In0).... | 1 | 0.164 s | 24.2% |  |
20 | Res(:,1) = cos(Alpha).*cos... | 1 | 0.055 s | 8.1% |  |
27 | Res = zeros(length(Ve... | 1 | 0.044 s | 6.5% |  |
21 | Res(:,2) = sin(Alpha).*cos... | 1 | 0.033 s | 4.8% |  |
All other lines | | | 0.175 s | 25.8% |  |
Totals | | | 0.678 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
Line number | Message |
1 | Extra semicolon is unnecessary. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 36 |
Non-code lines (comments, blank lines) | 15 |
Code lines (lines that can run) | 21 |
Code lines that did run | 18 |
Code lines that did not run | 3 |
Coverage (did run/can run) | 85.71 % |
Function listing
time calls line
1 function Res=cosined(Vec);
2 %--------------------------------------------------------------------
3 % cosined function cosine direction transformation
4 % convert lon & lat to cosine direction
5 % and visa versa. UNITS are in radians!
6 % input : - column matrix, with 2 or 3 colums.
7 % if 2 colums are given then, the first column
8 % is longitude and the second is latitude.
9 % and the cosine direction are returned.
10 % if three columns are given, then they suppose to
11 % be the cosine direction, and the longitude
12 % and latitude are returned.
13 % output : - cosine direction or longitude and latitude.
14 % By Eran O. Ofek July 1999
15 %--------------------------------------------------------------------
2 16 if (length(Vec(1,:))==2),
1 17 Alpha = Vec(:,1);
1 18 Delta = Vec(:,2);
0.02 1 19 Res = zeros(length(Vec(:,1)),3);
0.05 1 20 Res(:,1) = cos(Alpha).*cos(Delta);
0.03 1 21 Res(:,2) = sin(Alpha).*cos(Delta);
0.02 1 22 Res(:,3) = sin(Delta);
1 23 elseif (length(Vec(1,:))==3),
0.02 1 24 L1 = Vec(:,1);
0.01 1 25 L2 = Vec(:,2);
0.02 1 26 L3 = Vec(:,3);
0.04 1 27 Res = zeros(length(Vec(:,1)),2);
0.21 1 28 Res(:,1) = atan2(L2,L1); % Alpha
0.02 1 29 SLL = sqrt(L1.^2+L2.^2);
0.01 1 30 I0 = find(SLL==0);
0.02 1 31 In0 = find(SLL~=0);
0.16 1 32 Res(In0,2) = atan(L3(In0)./SLL(In0)); % Delta
1 33 Res(I0,2) = sign(L3(I0)).*pi./2; % Delta
34 else
35 error('only 2/3 columns are allowed');
36 end