Mercurial > hg > octave-nkf
comparison scripts/plot/util/findobj.m @ 20441:83792dd9bcc1
Use in-place operators in m-files where possible.
* scripts/audio/@audioplayer/set.m, scripts/audio/@audiorecorder/set.m,
scripts/audio/mu2lin.m, scripts/elfun/cosd.m, scripts/general/del2.m,
scripts/general/profexplore.m, scripts/general/quadl.m, scripts/general/rat.m,
scripts/general/rotdim.m, scripts/help/get_first_help_sentence.m,
scripts/help/private/__strip_html_tags__.m, scripts/image/cubehelix.m,
scripts/io/textread.m, scripts/linear-algebra/duplication_matrix.m,
scripts/linear-algebra/housh.m, scripts/linear-algebra/krylov.m,
scripts/linear-algebra/logm.m, scripts/linear-algebra/normest.m,
scripts/linear-algebra/onenormest.m, scripts/optimization/fminsearch.m,
scripts/optimization/lsqnonneg.m, scripts/optimization/qp.m,
scripts/plot/appearance/annotation.m, scripts/plot/appearance/axis.m,
scripts/plot/appearance/legend.m, scripts/plot/appearance/specular.m,
scripts/plot/draw/colorbar.m, scripts/plot/draw/hist.m,
scripts/plot/draw/plotmatrix.m, scripts/plot/draw/private/__stem__.m,
scripts/plot/util/__actual_axis_position__.m,
scripts/plot/util/__gnuplot_drawnow__.m, scripts/plot/util/findobj.m,
scripts/plot/util/print.m, scripts/plot/util/private/__go_draw_axes__.m,
scripts/plot/util/private/__print_parse_opts__.m, scripts/plot/util/rotate.m,
scripts/polynomial/pchip.m, scripts/polynomial/polyaffine.m,
scripts/polynomial/polyder.m, scripts/polynomial/private/__splinefit__.m,
scripts/polynomial/residue.m, scripts/signal/arch_fit.m,
scripts/signal/arch_rnd.m, scripts/signal/bartlett.m,
scripts/signal/blackman.m, scripts/signal/freqz.m, scripts/signal/hamming.m,
scripts/signal/hanning.m, scripts/signal/spectral_adf.m,
scripts/signal/spectral_xdf.m, scripts/signal/stft.m,
scripts/sparse/bicgstab.m, scripts/sparse/cgs.m,
scripts/sparse/private/__sprand_impl__.m, scripts/sparse/qmr.m,
scripts/sparse/sprandsym.m, scripts/sparse/svds.m, scripts/specfun/legendre.m,
scripts/special-matrix/gallery.m, scripts/statistics/base/gls.m,
scripts/statistics/models/logistic_regression.m,
scripts/statistics/tests/kruskal_wallis_test.m,
scripts/statistics/tests/manova.m, scripts/statistics/tests/wilcoxon_test.m,
scripts/time/datevec.m:
Use in-place operators in m-files where possible.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 26 May 2015 21:07:42 -0700 |
parents | ed53c87050e8 |
children | ba4088aee342 |
comparison
equal
deleted
inserted
replaced
20440:e914b5399c67 | 20441:83792dd9bcc1 |
---|---|
97 endif | 97 endif |
98 if (n1 <= nargin) | 98 if (n1 <= nargin) |
99 if (ischar (varargin{n1})) | 99 if (ischar (varargin{n1})) |
100 if (strcmpi (varargin{n1}, "flat")) | 100 if (strcmpi (varargin{n1}, "flat")) |
101 depth = 0; | 101 depth = 0; |
102 n1 = n1 + 1; | 102 n1 += 1; |
103 endif | 103 endif |
104 else | 104 else |
105 error ("findobj: properties and options must be strings"); | 105 error ("findobj: properties and options must be strings"); |
106 endif | 106 endif |
107 endif | 107 endif |
131 endif | 131 endif |
132 logicaloperator{np} = "and"; | 132 logicaloperator{np} = "and"; |
133 if (ischar (args{na})) | 133 if (ischar (args{na})) |
134 if (strcmpi (args{na}, "-property")) | 134 if (strcmpi (args{na}, "-property")) |
135 if (na + 1 <= numel (args)) | 135 if (na + 1 <= numel (args)) |
136 na = na + 1; | 136 na += 1; |
137 property(np) = 1; | 137 property(np) = 1; |
138 pname{np} = args{na}; | 138 pname{np} = args{na}; |
139 na = na + 1; | 139 na += 1; |
140 pvalue{np} = []; | 140 pvalue{np} = []; |
141 np = np + 1; | 141 np += 1; |
142 else | 142 else |
143 error ("findobj: inconsistent number of arguments"); | 143 error ("findobj: inconsistent number of arguments"); |
144 endif | 144 endif |
145 elseif (strcmpi (args{na}, "-regexp")) | 145 elseif (strcmpi (args{na}, "-regexp")) |
146 if (na + 2 <= numel (args)) | 146 if (na + 2 <= numel (args)) |
147 regularexpression(np) = 1; | 147 regularexpression(np) = 1; |
148 na = na + 1; | 148 na += 1; |
149 pname{np} = args{na}; | 149 pname{np} = args{na}; |
150 na = na + 1; | 150 na += 1; |
151 pvalue{np} = args{na}; | 151 pvalue{np} = args{na}; |
152 na = na + 1; | 152 na += 1; |
153 np = np + 1; | 153 np += 1; |
154 else | 154 else |
155 error ("findobj: inconsistent number of arguments"); | 155 error ("findobj: inconsistent number of arguments"); |
156 endif | 156 endif |
157 elseif (strcmpi (args{na}, "-depth")) | 157 elseif (strcmpi (args{na}, "-depth")) |
158 if (na + 1 <= numel (args)) | 158 if (na + 1 <= numel (args)) |
159 na = na + 1; | 159 na += 1; |
160 depth = args{na}; | 160 depth = args{na}; |
161 na = na + 1; | 161 na += 1; |
162 else | 162 else |
163 error ("findobj: inconsistent number of arguments"); | 163 error ("findobj: inconsistent number of arguments"); |
164 endif | 164 endif |
165 elseif (! strcmp (args{na}(1), "-")) | 165 elseif (! strcmp (args{na}(1), "-")) |
166 ## Parameter/value pairs. | 166 ## Parameter/value pairs. |
167 if (na + 1 <= numel (args)) | 167 if (na + 1 <= numel (args)) |
168 pname{np} = args{na}; | 168 pname{np} = args{na}; |
169 na = na + 1; | 169 na += 1; |
170 pvalue{np} = args{na}; | 170 pvalue{np} = args{na}; |
171 na = na + 1; | 171 na += 1; |
172 if (na <= numel (args)) | 172 if (na <= numel (args)) |
173 if (ischar (args{na})) | 173 if (ischar (args{na})) |
174 if (any (strcmpi (args{na}, operatorprecedence))) | 174 if (any (strcmpi (args{na}, operatorprecedence))) |
175 logicaloperator{np} = args{na}(2:end); | 175 logicaloperator{np} = args{na}(2:end); |
176 na = na+1; | 176 na += 1; |
177 endif | 177 endif |
178 else | 178 else |
179 error ("findobj: properties and options must be strings"); | 179 error ("findobj: properties and options must be strings"); |
180 endif | 180 endif |
181 else | 181 else |
182 logicaloperator{np} = "and"; | 182 logicaloperator{np} = "and"; |
183 endif | 183 endif |
184 np = np + 1; | 184 np += 1; |
185 else | 185 else |
186 error ("findobj: inconsistent number of arguments"); | 186 error ("findobj: inconsistent number of arguments"); |
187 endif | 187 endif |
188 else | 188 else |
189 if (strcmpi (args{na}, "-not")) | 189 if (strcmpi (args{na}, "-not")) |
190 extranegation(np) = true; | 190 extranegation(np) = true; |
191 endif | 191 endif |
192 na = na + 1; | 192 na += 1; |
193 endif | 193 endif |
194 else | 194 else |
195 error ("findobj: properties and options must be strings"); | 195 error ("findobj: properties and options must be strings"); |
196 endif | 196 endif |
197 endwhile | 197 endwhile |
209 for n = 1 : numel (handles) | 209 for n = 1 : numel (handles) |
210 children = [children; get(handles(n), "children")]; | 210 children = [children; get(handles(n), "children")]; |
211 endfor | 211 endfor |
212 handles = children; | 212 handles = children; |
213 h = [h; children]; | 213 h = [h; children]; |
214 idepth = idepth + 1; | 214 idepth += 1; |
215 endwhile | 215 endwhile |
216 | 216 |
217 if (numpairs > 0) | 217 if (numpairs > 0) |
218 match = true (numel (h), numpairs); | 218 match = true (numel (h), numpairs); |
219 for nh = 1 : numel (h) | 219 for nh = 1 : numel (h) |
265 else | 265 else |
266 match(:,np) = feval (logicaloperator{np+1}, match(:,np), ... | 266 match(:,np) = feval (logicaloperator{np+1}, match(:,np), ... |
267 match(:,np+1)); | 267 match(:,np+1)); |
268 logicaloperator(np+1) = []; | 268 logicaloperator(np+1) = []; |
269 match(:,np+1) = []; | 269 match(:,np+1) = []; |
270 numpairs = numpairs - 1; | 270 numpairs -= 1; |
271 endif | 271 endif |
272 if (numpairs < 2) | 272 if (numpairs < 2) |
273 break; | 273 break; |
274 endif | 274 endif |
275 endfor | 275 endfor |