Topic might be missleading so here's what I want to achieve in Oactave/Matlab (result preferably row-wise in a matrix):
Let $\lambda=(\lambda_1,\ldots,\lambda_k)\in\mathbb{N}^k_{\geq0}$. So I want all the tuples fullfilling: $0\leq\lambda_1\leq\lambda_2\leq\ldots\leq\lambda_k\leq n$ for a given $n\in\mathbb{N}$. I also would like to able to teawk the alogrithm to exchange the $\leq$ for a $<$.
So for $k=2$, $n=3$ it should give something like that:
0 0
0 1
0 2
0 3
1 1
1 2
1 3
2 2
2 3
3 3
The following Octave code should work in the $\leq$ case. It can be modified to work in the $<$ case as well. The amount of work to compute all tuples in the $\leq$ case is proportional to $k {n + k\choose k}$.