If you personally prefer any other definition (including zeroes, for example) they can be obtained from the one given by this function. See my first post.
Anyway, what Steffen is trying to compute are "weak compositions" and the goal of this function is to compute "compositions". It would be interesting to have a general implementation for "weak compositions" allowing also independent upper and lower bounds for each term.
It is true that this function should return all the compositions/partitions in a cell array (or array when all of them have the same length). Also, it should check the input arguments to avoid prohibited values.
An additional question: what happens if argument "a" takes negative values? Personally, I think it is just as weird as setting a=0.