# Partition vector

I have a vector composed of 10 elements and I want to "split" it into two vectors composed of five elements:

q={1,2,3,4,5,6,7,8,9,10};Partition[q,5]


but the output is a matrix...

{{1,2,3,4,5},{6,7,8,9,10}}


How can I obtain 2 separated vectors rather than a matrix?

• What are 'two separated vectors'? Sequence @@ Partition[q,5]? It will still have Sequence head but that is the closest concept I suppose.
– Kuba
Jun 22 '17 at 15:10
• @tomd: Huh? Doesn't your answer give precisely what the poser's (unsatisfactory) answer gives? Jun 22 '17 at 16:05
• Don't think of it as a matrix, think of it as a list of vectors. You can do [[1]] or //First or any other list operation to extract the first and second vectors. Jun 22 '17 at 19:45

The output of a line of Mathematica code is a single element, so

Partition[q,5]


is all you can get. If you want to access the parts individually:

Partition[q,5][[1]]


and

Partition[q,5][[2]]


What exactly do you want this for? (That will help us help you.)

q = {1,2,3,4,5,6,7,8,9,10};