This is a static copy of a profile report

Home

genfigAlpha (1 call, 2.579 sec)
Generated 05-Aug-2011 13:01:31 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/plotting/genfigAlpha.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
99
eval(sprintf('print -dpng -r20...
41.760 s68.2%
84
h(pageNum,plotNum,1:linesPerPl...
480.492 s19.1%
81
subplot(matrix(1),matrix(2),pl...
480.219 s8.5%
92
gtitle(bigTitle);
480.077 s3.0%
79
clf;
40.033 s1.3%
All other lines  0 s0%
Totals  2.579 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
printfunction41.760 s68.2%
genfigAlpha>plotflagsubfunction480.481 s18.6%
subplotfunction480.208 s8.1%
gtitlefunction480.077 s3.0%
clffunction40.033 s1.3%
genfigAlpha>swapIndexsubfunction480 s0%
setwinsizefunction40 s0%
gcffunction80 s0%
getMainDirfunction10 s0%
Self time (built-ins, overhead, etc.)  0.022 s0.8%
Totals  2.579 s100% 
Code Analyzer results
Line numberMessage
1Input argument 'prop' might be unused, although a later one is used. Consider replacing it by ~.
32EXIST with two input arguments is generally faster and clearer than with one input argument.
63The variable 'plotsPerPage' appears to change size on every loop iteration. Consider preallocating for speed.
66The variable 'plotsPerPage' appears to change size on every loop iteration. Consider preallocating for speed.
73The value assigned to variable 'final_flags' might be unused.
76The value assigned to variable 'pageNum' might be unused.
84The value assigned to variable 'h' might be unused.
84The variable 'h' appears to change size on every loop iteration. Consider preallocating for speed.
106Loop index 'pageNum' is changed inside of a FOR loop.
Coverage results
[ Show coverage for parent directory ]
Total lines in function109
Non-code lines (comments, blank lines)50
Code lines (lines that can run)59
Code lines that did run50
Code lines that did not run9
Coverage (did run/can run)84.75 %
Function listing
   time   calls  line
1 function genfigAlpha(d, flags, xc, txt, ax, type, prop, field, saveplot)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 % function [flags, finalFlags] = plot_alpha(d, flags, xc, txt, ax, type, prop, field);
5 %
6 % d - data structure
7 % flag - flag structure
8 % xc - cell element of x and y data
9 % x{odd} - x axis data
10 % x{even} - y axis data Nx24
11 % txt - axis text
12 % txt{1} - title
13 % txt{2} - x axis
14 % txt{3} - y axis
15 % txt[4} - overall title
16 % txt{5} - legend
17 % ax - manual axis settings. [xmin xmax ymin ymax]
18 % type - type of plot (not needed, but for some convention with other functions)
19 % prop - initialize properties of plotting
20 % p.style = {'flag'}
21 % p.featmask= [bitmask for style='feature']
22 % field - data reduction field name.
23 %
24 %
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
1 27 if(nargin<9)
28 saveplot = 1;
29 end
30
31 % check for axis setting
1 32 if (~exist('ax'))
33 ax=[];
34 end
35
1 36 if(saveplot)
37 % get the directory to write to
1 38 maindir=getmaindir(d, field);
1 39 end
40
41 % num is the number of pages to be displayed.
42 % matrix is the size of each of the pages to be displayed.
1 43 if(size(xc{2,1},2)~=2)
44 error('Should not be using plot_alpha');
45 end
46
47 % each page will have noise diode events for a single intensity channel.
48 % There will be at most 16 plots per page, and the number of pages will be
49 % doubled due to the next intensity channel.
50
1 51 numPlots = length(xc)/2;
1 52 matrix = [4 4];
1 53 linesPerPlot = 2;
1 54 p.swap = 0;
1 55 num = 2*ceil(numPlots/16); % number of pages
56
57
58 % need to calculate the number of plots for each page.
1 59 nPlots = numPlots;
1 60 m=1;
1 61 while(nPlots >0)
2 62 if(nPlots>=16)
1 63 plotsPerPage(m) = 16;
1 64 nPlots = nPlots - 16;
1 65 else
1 66 plotsPerPage(m) = nPlots;
1 67 nPlots = 0;
1 68 end
2 69 m = m+1;
2 70 end
71 % repeat it
1 72 plotsPerPage = [plotsPerPage plotsPerPage];
1 73 final_flags = zeros(1,numPlots);
74
75
1 76 pageNum=1;
1 77 for pageNum=1:num
4 78 setwinsize(gcf, 1000, 750);
0.03 4 79 clf;
4 80 for plotNum=1:plotsPerPage(pageNum)
0.22 48 81 subplot(matrix(1),matrix(2),plotNum)
82 % plot data
48 83 [m,n]=swapIndex(p.swap,pageNum,plotNum);
0.49 48 84 h(pageNum,plotNum,1:linesPerPlot)=plotflag(xc,flags,ax,m,n,txt,num,matrix,plotsPerPage);
85
48 86 if (length(txt)>3)
48 87 if(pageNum > (num/2))
24 88 bigTitle = sprintf('Channel 6 %s', txt{4}{1});
24 89 else
24 90 bigTitle = sprintf('Channel 1 %s', txt{4}{1});
24 91 end
0.08 48 92 gtitle(bigTitle);
48 93 end
48 94 end
95
4 96 if(saveplot)
4 97 dbclear if error
4 98 set(gcf,'paperposition',[0 0 6.0 6.0])
1.76 4 99 eval(sprintf('print -dpng -r200 %s/%s/fig%u.png;', ...
100 maindir,type,pageNum));
4 101 dbstop if error
102 else
103 pause(1);
104 end
105
4 106 pageNum=pageNum+1;
4 107 end
108
1 109 return;

Other subfunctions in this file are not included in this listing.