changeset 30866:a8d61c30f41a

doc: Update copy&paste error in documentation for ind2sub. * sub2ind.cc (Find2sub): Re-write documentation that was copied from sub2ind() to be appropriate for ind2sub().
author Rik <rik@octave.org>
date Sat, 26 Mar 2022 14:25:34 -0700
parents 4026b5fbc67d
children 79edd49a5a97
files libinterp/corefcn/sub2ind.cc
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/sub2ind.cc	Thu Mar 24 12:11:10 2022 -0400
+++ b/libinterp/corefcn/sub2ind.cc	Sat Mar 26 14:25:34 2022 -0700
@@ -195,7 +195,7 @@
 
 The input @var{dims} is a dimension vector where each element is the size of
 the array in the respective dimension (@pxref{XREFsize,,@code{size}}).  The
-second input @var{ind} contains linear indies to be converted.
+second input @var{ind} contains linear indices to be converted.
 
 The outputs @var{s1}, @dots{}, @var{sN} contain the converted subscripts.
 
@@ -220,12 +220,8 @@
 The left matrix contains the linear indices for each matrix element.  The right
 matrix shows the subscript tuples for the same matrix.
 
-The following example shows how to convert the two-dimensional indices
-@code{(2,1)} and @code{(2,3)} of a 3-by-3 matrix to linear indices with a
-single call to @code{sub2ind}.
-
 The following example shows how to convert the linear indices @code{2} and
-@code{8} in a 3-by-3 matrix into subscripts.
+@code{8} to appropriate subscripts of a 3-by-3 matrix.
 
 @example
 @group