So andrewsplot states that "The rows of X correspond to observations, the columns to variables". It seems that you have instead used the columns to present the groups of observations (e.g. nObs x nGroups instead of nObs x nVars).
Assuming x is indeed nObs=2500 x nGroups=6, the following code will group your data correctly:
Since you have only one variable with 2500 observations per six groups,
Creates the required nObs=2500*6 x nVars=1 array.
Creates a nObs=2500*6 x 1 group array with the group members [1...1 2...2 3...3 4...4 5...5 6...6]' etc. (each group block repeated 2500 times). You might replace that with your grouping assignment, e.g.: