This is a static copy of a profile report

Home

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 NameFunction TypeCalls
packdfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
84
eval(sprintf('print -dpng -r20...
11.836 s45.4%
69
[boo, coo, h(pageNum, plotNum,...
61.749 s43.2%
72
xlabel(txt{2});
60.142 s3.5%
73
ylabel(txt{3});
60.120 s3.0%
75
title(thisTitle);
60.109 s2.7%
All other lines  0.087 s2.2%
Totals  4.044 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
printfunction11.836 s45.4%
plot_powerspecfunction61.727 s42.7%
xlabelfunction60.142 s3.5%
ylabelfunction60.120 s3.0%
titlefunction60.109 s2.7%
subplotfunction60.044 s1.1%
gcffunction20.011 s0.3%
gtitlefunction10 s0%
setwinsizefunction10 s0%
getMainDirfunction10 s0%
Self time (built-ins, overhead, etc.)  0.055 s1.4%
Totals  4.044 s100% 
Code Analyzer results
Line numberMessage
1Input argument 'xc' might be unused, although a later one is used. Consider replacing it by ~.
1Input argument 'ax' might be unused, although a later one is used. Consider replacing it by ~.
1Input argument 'prop' might be unused, although a later one is used. Consider replacing it by ~.
1Extra semicolon is unnecessary.
28EXIST with two input arguments is generally faster and clearer than with one input argument.
29The value assigned to variable 'ax' might be unused.
40The value assigned to variable 'num' might be unused.
57The value assigned to variable 'timeVal' might be unused.
60The value assigned to variable 'fmode' might be unused.
60Use TRUE or FALSE instead of LOGICAL(1) or LOGICAL(0).
69The value assigned here to 'boo' appears to be unused. Consider replacing it by ~.
69The value assigned here to 'coo' appears to be unused. Consider replacing it by ~.
69The value assigned to variable 'h' might be unused.
69The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed.
69The value assigned to variable 'NFFT' might be unused.
Coverage results
[ Show coverage for parent directory ]
Total lines in function89
Non-code lines (comments, blank lines)47
Code lines (lines that can run)42
Code lines that did run34
Code lines that did not run8
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.