
function M = roll( vector, dimensoes )
   proc = 0;
   L = length(dimensoes);

   for c = 1:L-1,
      lin = dimensoes(c+1);
      col = dimensoes(c) + 1;
      M{c} = reshape( vector(proc+1 : proc+lin*col), lin, col);
      proc += lin*col;
   end
end

