This is a static copy of a profile reportHome
genfig>plotfeat (48 calls, 2.055 sec)
Generated 05-Aug-2011 13:03:28 using cpu time.
subfunction in file /home/LeechJ/cbass_analysis/reduc/plotting/genfig.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
genfig | function | 48 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
142 | eval(txt1); eval(txt2); | 576 | 0.874 s | 42.6% |  |
147 | eval(txtPlot); | 198 | 0.437 s | 21.3% |  |
121 | h = plot(x{1,pageNum}, x{2,pag... | 24 | 0.328 s | 16.0% |  |
165 | plotdescription(txt,plotNum,pa... | 48 | 0.186 s | 9.0% |  |
148 | hold on; | 198 | 0.077 s | 3.7% |  |
All other lines | | | 0.153 s | 7.4% |  |
Totals | | | 2.055 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
109 | Input argument 'allflags' might be unused, although a later one is used. Consider replacing it by ~. |
115 | The value assigned here to 'clr' appears to be unused. Consider replacing it by ~. |
145 | The variable 'a' might be used before it is defined. |
149 | The variable 'leg' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 61 |
Non-code lines (comments, blank lines) | 21 |
Code lines (lines that can run) | 40 |
Code lines that did run | 34 |
Code lines that did not run | 6 |
Coverage (did run/can run) | 85.00 % |
Function listing
time calls line
109 function [h, leg] = plotfeat(x,allflags,ax,pageNum,plotNum,txt,num,matrix,swap, type)
110
111 % get the features to plot
112 % we only have {source, calibrator, abscal, blank, skydip, noise_event, and noise}
113
114 % get the color and legend
48 115 [clr, legall] = getcolor(type);
116
117 % we only need to plot the ones with legall
48 118 switch type
48 119 case 'allflags'
120 % first we just plot the data
0.33 24 121 h = plot(x{1,pageNum}, x{2,pageNum}(:,plotNum), 'k.'); hold on
24 122 index = 2;
24 123 leg{1} = 'data';
124
24 125 case 'feature'
24 126 index = 1;
24 127 leg = [];
24 128 h = [];
24 129 end
130
48 131 for m=1:length(legall)
576 132 switch type
576 133 case 'allflags'
0.02 408 134 txt1 = sprintf('a = x{1,pageNum}(x{3,pageNum}.%s(:,plotNum));', legall{m});
408 135 txt2 = sprintf('b = x{2,pageNum}(x{3,pageNum}.%s(:,plotNum), plotNum);', legall{m});
136
168 137 case 'feature'
168 138 txt1 = sprintf('a = x{1,pageNum}(x{3,pageNum}.%s);', legall{m});
168 139 txt2 = sprintf('b = x{2,pageNum}(x{3,pageNum}.%s, plotNum);', legall{m});
168 140 end
141
0.87 576 142 eval(txt1); eval(txt2);
143
144 % do not plot if there are no data points to plot
0.07 576 145 if(sum(a)>0)
0.01 198 146 txtPlot = sprintf('h = plot(a, b, ''.'', ''markerfacecolor'', clr(m,:), ''markeredgecolor'', clr(m,:), ''MarkerSize'',10);');
0.44 198 147 eval(txtPlot);
0.08 198 148 hold on;
198 149 leg{index} = legall{m};
198 150 index = index+1;
198 151 end
576 152 end
153
48 154 if(isempty(h))
155 % no data to plot in this section
156 a = x{1,pageNum};
157 b = zeros(size(a));
158 h = plot(a,b,'w');
159 text(a(1), b(1), 'DATA HAS NO INTENT', 'FontSize', 18);
160 text(a(1), -0.25, 'FOR THIS TIME PERIOD', 'FontSize', 18);
161 end
162
163
0.02 48 164 manaxis(ax,x{2,pageNum}(:,plotNum))
0.19 48 165 plotdescription(txt,plotNum,pageNum,num,matrix,swap);
166
0.02 48 167 hold off
168
0.01 48 169 return;
Other subfunctions in this file are not included in this listing.