Home > freetb4matlab > general > sub2ind.m

sub2ind

PURPOSE ^

% Convert subscripts into a linear index.

SYNOPSIS ^

function ind = sub2ind (dims, varargin)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{i}, @var{j})
% @deftypefnx {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{s1}, @var{s2}, @dots{}, @var{sN})
% Convert subscripts into a linear index.
%
% The following example shows how to convert the two-dimensional
% index @code{(2,3)} of a 3-by-3 matrix to a linear index.  The matrix
% is linearly indexed moving from one column to next, filling up
% all rows in each column.
%
% @example
% @group
% linear_index = sub2ind ([3, 3], 2, 3)
% @result{} 8
% @end group
% @end example
% @seealso{ind2sub}
% @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