How to extract the vector from each segment

Search the forum first.