Converts a linear index to an array of subscripts.
The function accepts the following "modes":
throw
wrap
clamp
0
array shape
linear index
function options
specifies how to handle a linear index which exceeds array dimensions (default: 'throw')
specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
shape argument must be an array-like object containing nonnegative integers
must provide valid options
must provide a linear index which does not exceed array dimensions
subscripts
Converts a linear index to an array of subscripts.
Notes
The function accepts the following "modes":
throw
: throws an error when a linear index exceeds array dimensions.wrap
: wrap around a linear index exceeding array dimensions using modulo arithmetic.clamp
: set a linear index exceeding array dimensions to either0
(minimum linear index) or the maximum linear index.array shape
linear index
function options
specifies how to handle a linear index which exceeds array dimensions (default: 'throw')
specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
shape argument must be an array-like object containing nonnegative integers
must provide valid options
must provide a linear index which does not exceed array dimensions
subscripts