This is a static copy of a profile reportHome
genfigPowerSpec (1 call, 4.044 sec)
Generated 05-Aug-2011 13:01:31 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/plotting/genfigPowerSpec.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
packd | function | 1 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
84 | eval(sprintf('print -dpng -r20... | 1 | 1.836 s | 45.4% |  |
69 | [boo, coo, h(pageNum, plotNum,... | 6 | 1.749 s | 43.2% |  |
72 | xlabel(txt{2}); | 6 | 0.142 s | 3.5% |  |
73 | ylabel(txt{3}); | 6 | 0.120 s | 3.0% |  |
75 | title(thisTitle); | 6 | 0.109 s | 2.7% |  |
All other lines | | | 0.087 s | 2.2% |  |
Totals | | | 4.044 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
print | function | 1 | 1.836 s | 45.4% |  |
plot_powerspec | function | 6 | 1.727 s | 42.7% |  |
xlabel | function | 6 | 0.142 s | 3.5% |  |
ylabel | function | 6 | 0.120 s | 3.0% |  |
title | function | 6 | 0.109 s | 2.7% |  |
subplot | function | 6 | 0.044 s | 1.1% |  |
gcf | function | 2 | 0.011 s | 0.3% |  |
gtitle | function | 1 | 0 s | 0% |  |
setwinsize | function | 1 | 0 s | 0% |  |
getMainDir | function | 1 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.055 s | 1.4% |  |
Totals | | | 4.044 s | 100% | |
Code Analyzer results
Line number | Message |
1 | Input argument 'xc' might be unused, although a later one is used. Consider replacing it by ~. |
1 | Input argument 'ax' might be unused, although a later one is used. Consider replacing it by ~. |
1 | Input argument 'prop' might be unused, although a later one is used. Consider replacing it by ~. |
1 | Extra semicolon is unnecessary. |
28 | EXIST with two input arguments is generally faster and clearer than with one input argument. |
29 | The value assigned to variable 'ax' might be unused. |
40 | The value assigned to variable 'num' might be unused. |
57 | The value assigned to variable 'timeVal' might be unused. |
60 | The value assigned to variable 'fmode' might be unused. |
60 | Use TRUE or FALSE instead of LOGICAL(1) or LOGICAL(0). |
69 | The value assigned here to 'boo' appears to be unused. Consider replacing it by ~. |
69 | The value assigned here to 'coo' appears to be unused. Consider replacing it by ~. |
69 | The value assigned to variable 'h' might be unused. |
69 | The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed. |
69 | The value assigned to variable 'NFFT' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 89 |
Non-code lines (comments, blank lines) | 47 |
Code lines (lines that can run) | 42 |
Code lines that did run | 34 |
Code lines that did not run | 8 |
Coverage (did run/can run) | 80.95 % |
Function listing
time calls line
1 function genfigPowerSpec(d, xc, txt, ax, prop, type, field, saveplot);
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 % function genfigPowerSpec(d, xc, txt, ax, prop, type, field, saveplot);
5 %
6 % d - data structure
7 % xc - cell element of x and y data
8 % x{odd} - x axis data
9 % x{even} - y axis data Nx1 or Nx6 or Nx24
10 % txt - axis text
11 % txt{1} - title
12 % txt{2} - x axis
13 % txt{3} - y axis
14 % txt[4} - overall title
15 % txt{5} - legend
16 % ax - manual axis settings. [xmin xmax ymin ymax]
17 % prop - initialize properties of plotting
18 % p.style = {'flag','feature'}
19 % p.swap = swap to display plots in time.
20 % p.featmask= [bitmask for style='feature']
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1 22 if(nargin<8)
23 saveplot = 1;
24 end
25
26
27 % check for axis setting
1 28 if (~exist('ax'))
29 ax=[];
30 end
31
1 32 if(saveplot)
33 % get the directory to write to
1 34 maindir=getmaindir(d, field);
1 35 end
36
37
38 % num is the number of pages to be displayed.
39 % matrix is the size of each of the pages to be displayed.
1 40 num = 1;
1 41 plotsPerPage = 6;
1 42 matrix = [3 2];
43
1 44 plotoptions = {'b', 'g', 'r', 'c', 'm', 'y', 'k', ...
45 'b.', 'g.', 'r.', 'c.', 'm.', 'y.', 'k.', ...
46 'bo', 'go', 'ro', 'co', 'mo', 'yo', 'ko', ...
47 'bx', 'gx', 'rx', 'cx', 'mx', 'yx', 'kx'};
48
49
1 50 if(isfield(d.antenna0.receiver, 'dataT'))
51 data = d.antenna0.receiver.dataT;
1 52 else
1 53 data = d.antenna0.receiver.data;
1 54 end
55
0.01 1 56 timeVal = d.antenna0.receiver.utc*24*60*60;
1 57 timeVal = timeVal - timeVal(1);
58
1 59 pageNum=1;
1 60 fmode=logical(0);
61
1 62 setwinsize(gcf, 1000, 750);
1 63 clear leg;
1 64 for plotNum=1:plotsPerPage
0.04 6 65 subplot(matrix(1),matrix(2),plotNum)
66 % plot data
0.01 6 67 optionIndex = 1;
68 % before data
1.75 6 69 [boo, coo, h(pageNum, plotNum,optionIndex) NFFT] = plot_powerspec(d, ...
70 data(:,plotNum), 1, [], [], plotoptions{1});
71
0.14 6 72 xlabel(txt{2});
0.12 6 73 ylabel(txt{3});
6 74 thisTitle = sprintf('%s %u', txt{1}{1}, plotNum);
0.11 6 75 title(thisTitle);
76
6 77 end
78
1 79 gtitle('Power Spectrum Plots');
80
1 81 if(saveplot)
1 82 dbclear if error
0.01 1 83 set(gcf,'paperposition',[0 0 6.0 6.0])
1.84 1 84 eval(sprintf('print -dpng -r200 %s/%s/fig%d.png;', ...
85 maindir,type,pageNum));
1 86 dbstop if error
87 else
88 pause(1);
89 end
Other subfunctions in this file are not included in this listing.