Emulates the MATLAB function sub2ind.

sub2ind(dims, indices)

Arguments

dims

vector of dimensions of object to index into.

indices

vector of n-dimensional indices.