Traversing a hyperplane

22 Views Asked by At

I am trying to implement (using Matlab) the traversal of $$\left\{\left(k_1,..., k_N\right)^{\mathsf{T}}\in\mathbb{N}_0^N: \sum_{i=1}^N k_i=c\right\}$$ where $c\in\mathbb{N}_0$ is a prescribed constant. Is there an easy recursive or even explicit way to do this?