Home > freetb4matlab > general > ind2sub.m

ind2sub

PURPOSE ^

% Convert a linear index into subscripts.

SYNOPSIS ^

function varargout = ind2sub (dims, ind)

DESCRIPTION ^

% -*- 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003