2 nout = length(sizeVec);
3 sizeVec = double(sizeVec);
4 sizeVec = [sizeVec ones(1,nout-length(sizeVec))];
7 k = [1 cumprod(sizeVec(1:end-1))];
9 vi = rem(indVec-1, k(i)) + 1;
10 vj = (indVec - vi)/k(i) + 1;
function ind2submat(in sizeVec, in indVec)
IND2SUBMAT works similarly to the built-in ind2sub function but returns all the indices in a single m...