Mercurial > hg > octave-lyh
comparison src/DLD-FUNCTIONS/sub2ind.cc @ 11553:01f703952eff
Improve docstrings for functions in DLD-FUNCTIONS directory.
Use same variable names in error() strings and in documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 16 Jan 2011 22:13:23 -0800 |
parents | fd0a3ac60b0e |
children | 57632dea2446 |
comparison
equal
deleted
inserted
replaced
11552:6b6e9051ecb8 | 11553:01f703952eff |
---|---|
63 | 63 |
64 DEFUN_DLD (sub2ind, args, , | 64 DEFUN_DLD (sub2ind, args, , |
65 "-*- texinfo -*-\n\ | 65 "-*- texinfo -*-\n\ |
66 @deftypefn {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{i}, @var{j})\n\ | 66 @deftypefn {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{i}, @var{j})\n\ |
67 @deftypefnx {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{s1}, @var{s2}, @dots{}, @var{sN})\n\ | 67 @deftypefnx {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{s1}, @var{s2}, @dots{}, @var{sN})\n\ |
68 Convert subscripts into a linear index.\n\ | 68 Convert subscripts to a linear index.\n\ |
69 \n\ | 69 \n\ |
70 The following example shows how to convert the two-dimensional\n\ | 70 The following example shows how to convert the two-dimensional\n\ |
71 index @code{(2,3)} of a 3-by-3 matrix to a linear index. The matrix\n\ | 71 index @code{(2,3)} of a 3-by-3 matrix to a linear index. The matrix\n\ |
72 is linearly indexed moving from one column to next, filling up\n\ | 72 is linearly indexed moving from one column to next, filling up\n\ |
73 all rows in each column.\n\ | 73 all rows in each column.\n\ |
171 */ | 171 */ |
172 | 172 |
173 DEFUN_DLD (ind2sub, args, nargout, | 173 DEFUN_DLD (ind2sub, args, nargout, |
174 "-*- texinfo -*-\n\ | 174 "-*- texinfo -*-\n\ |
175 @deftypefn {Function File} {[@var{s1}, @var{s2}, @dots{}, @var{sN}] =} ind2sub (@var{dims}, @var{ind})\n\ | 175 @deftypefn {Function File} {[@var{s1}, @var{s2}, @dots{}, @var{sN}] =} ind2sub (@var{dims}, @var{ind})\n\ |
176 Convert a linear index into subscripts.\n\ | 176 Convert a linear index to subscripts.\n\ |
177 \n\ | 177 \n\ |
178 The following example shows how to convert the linear index @code{8}\n\ | 178 The following example shows how to convert the linear index @code{8}\n\ |
179 in a 3-by-3 matrix into a subscript. The matrix is linearly indexed\n\ | 179 in a 3-by-3 matrix into a subscript. The matrix is linearly indexed\n\ |
180 moving from one column to next, filling up all rows in each column.\n\ | 180 moving from one column to next, filling up all rows in each column.\n\ |
181 \n\ | 181 \n\ |
182 @example\n\ | 182 @example\n\ |
183 @group\n\ | 183 @group\n\ |
184 [r, c] = ind2sub ([3, 3], 8)\n\ | 184 [r, c] = ind2sub ([3, 3], 8)\n\ |
185 @result{} r = 2\n\ | 185 @result{} r = 2\n\ |
186 c = 3\n\ | 186 c = 3\n\ |
187 @end group\n\ | 187 @end group\n\ |
188 @end example\n\ | 188 @end example\n\ |
189 @seealso{sub2ind}\n\ | 189 @seealso{sub2ind}\n\ |
190 @end deftypefn") | 190 @end deftypefn") |
191 { | 191 { |