| Description |
This is a function to aid/simplify access to subsections of a n-d matrix.
Y=SUBMAT(X,DIM,LIST) creates a matrix Y that is the matrix X reduced along dimension DIM to the indices in LIST. If DIM is a list of dimensions, LIST is used to reduce each dimension. LIST also may be any string that can be evaluated to valid indices along DIM such as '1:end-1', '[2 4]', 'X(2,:)', and 'some_other_function'. DIM can not be a string!
Y=SUBMAT(X,DIM1,LIST1,DIM2,LIST2,...) allows for access to multiple dimensions independently. |