I have a question regarding the most efficient way to select a substring of
a vector:

I have a vector of value v, and I want to select a subspace of this vector
called w such that:

w=v[1:n]

where

sum(w) = x

I am interested in what you thing would be the most efficient way to do this
- I would like to avoid slowing down my simulations as much as possible.

Thank you very much for any help that anyone is able to give.

	[[alternative HTML version deleted]]

