For example I want to list all row vectors (1,5) whose elements are positive integers and sum of elements equals to 20. I am looking for a fast way which not use the loop-for for each elements. Please help.
MATLAB: What is the fastest way to list all positive integer vectors whose sum of elements equals K.
integerlistsumvectors
Best Answer