comparison src/DLD-FUNCTIONS/lookup.cc @ 12639:4d777e05d47c stable

doc: Review and update documentation for "Matrix Manipulation" chapter. * matrix.txi, arrayfun.m, blkdiag.m, fliplr.m, flipud.m, logspace.m, postpad.m, prepad.m, randi.m, repmat.m, rot90.m, rotdim.m, shiftdim.m, sortrows.m, vech.m, xor.m, hadamard.m, hankel.m, hilb.m, invhilb.m, magic.m, pascal.m, rosser.m, sylvester_matrix.m, toeplitz.m, vander.m, wilkinson.m, bsxfun.cc, find.cc, lookup.cc, rand.cc, tril.cc, data.cc, arrayfun.m, blkdiag.m, fliplr.m, flipud.m, logspace.m, postpad.m, prepad.m, randi.m, repmat.m, rot90.m, rotdim.m, shiftdim.m, sortrows.m, vech.m, xor.m, hadamard.m, hankel.m, hilb.m, invhilb.m, magic.m, pascal.m, rosser.m, sylvester_matrix.m, toeplitz.m, vander.m, wilkinson.m, bsxfun.cc (bsxfun), find.cc (find), lookup.cc (lookup), rand.cc (rand, randn, rande, randg, randp), tril.cc (triu), data.cc (all, any, horzcat, vertcat, cat, permute, ipermute, ones, zeros, eye, linspace, resize, reshape, issorted, diff): Improve docstrings
author Rik <octave@nomad.inbox5.com>
date Sun, 01 May 2011 08:55:15 -0700
parents 12df7854fa7c
children 72c96de7a403
comparison
equal deleted inserted replaced
12637:d02798e9eeae 12639:4d777e05d47c
186 return retval; 186 return retval;
187 } 187 }
188 188
189 DEFUN_DLD (lookup, args, , 189 DEFUN_DLD (lookup, args, ,
190 "-*- texinfo -*-\n\ 190 "-*- texinfo -*-\n\
191 @deftypefn {Loadable Function} {@var{idx} =} lookup (@var{table}, @var{y}, @var{opt})\n\ 191 @deftypefn {Loadable Function} {@var{idx} =} lookup (@var{table}, @var{y})\n\
192 @deftypefnx {Loadable Function} {@var{idx} =} lookup (@var{table}, @var{y}, @var{opt})\n\
192 Lookup values in a sorted table. Usually used as a prelude to\n\ 193 Lookup values in a sorted table. Usually used as a prelude to\n\
193 interpolation.\n\ 194 interpolation.\n\
194 \n\ 195 \n\
195 If table is increasing and @code{idx = lookup (table, y)}, then\n\ 196 If table is increasing and @code{idx = lookup (table, y)}, then\n\
196 @code{table(idx(i)) <= y(i) < table(idx(i+1))} for all @code{y(i)}\n\ 197 @code{table(idx(i)) <= y(i) < table(idx(i+1))} for all @code{y(i)}\n\
197 within the table. If @code{y(i) < table (1)} then\n\ 198 within the table. If @code{y(i) < table(1)} then\n\
198 @code{idx(i)} is 0. If @code{y(i) >= table(end)} or @code{isnan (y(i))} then\n\ 199 @code{idx(i)} is 0. If @code{y(i) >= table(end)} or @code{isnan (y(i))} then\n\
199 @code{idx(i)} is @code{n}.\n\ 200 @code{idx(i)} is @code{n}.\n\
200 \n\ 201 \n\
201 If the table is decreasing, then the tests are reversed.\n\ 202 If the table is decreasing, then the tests are reversed.\n\
202 For non-strictly monotonic tables, empty intervals are always skipped.\n\ 203 For non-strictly monotonic tables, empty intervals are always skipped.\n\
209 \n\ 210 \n\
210 @var{table} and @var{y} can also be cell arrays of strings\n\ 211 @var{table} and @var{y} can also be cell arrays of strings\n\
211 (or @var{y} can be a single string). In this case, string lookup\n\ 212 (or @var{y} can be a single string). In this case, string lookup\n\
212 is performed using lexicographical comparison.\n\ 213 is performed using lexicographical comparison.\n\
213 \n\ 214 \n\
214 If @var{opts} is specified, it shall be a string with letters indicating\n\ 215 If @var{opts} is specified, it must be a string with letters indicating\n\
215 additional options.\n\ 216 additional options.\n\
216 \n\ 217 \n\
217 @table @code\n\ 218 @table @code\n\
218 @item m\n\ 219 @item m\n\
219 @code{table(idx(i)) == val(i)} if @code{val(i)}\n\ 220 @code{table(idx(i)) == val(i)} if @code{val(i)}\n\