sliceMatrix is used to represent row vector or column vector of an arbitary matrix.