# HG changeset patch # User Rik # Date 1648329934 25200 # Node ID a8d61c30f41af52168f16d42d964d548950a892e # Parent 4026b5fbc67dc49e933aac8d7a7271aea00807c3 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(). diff -r 4026b5fbc67d -r a8d61c30f41a libinterp/corefcn/sub2ind.cc --- 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