Let us consider that we have a vector VEC
.
Is ther a way to find which vector elements can be grouped so as they sum up to a given number NUM in MATLAB?
For example if VEC = [2 5 7 10]
and NUM = 17
The requested algorithm should provide the answer that subvectors [2 5 10]
and [7 10]
sum up to given NUM
.