% -*- texinfo -*- % @deftypefn {Function File} {[@var{s1}, @var{s2}, @dots{}, @var{sN}] =} ind2sub (@var{dims}, @var{ind}) % Convert a linear index into subscripts. % % The following example shows how to convert the linear index @code{8} % in a 3-by-3 matrix into a subscript. The matrix is linearly indexed % moving from one column to next, filling up all rows in each column. % @example % @group % [r, c] = ind2sub ([3, 3], 8) % @result{} r = 2 % c = 3 % @end group % @end example % @seealso{sub2ind} % @end deftypefn