>> a = [1,2,4,5,7,8,10,9,12,19,22,21];
>> c = hankel(a(1:3),a(3:end)).'
c =
1 2 4
2 4 5
4 5 7
5 7 8
7 8 10
8 10 9
10 9 12
9 12 19
12 19 22
19 22 21
And compared against your requested output:
>> b = [1,2,4;2,4,5;4,5,7;5,7,8;7,8,10;8,10,9;10,9,12;9,12,19;12,19,22;19,22,21]
b =
1 2 4
2 4 5
4 5 7
5 7 8
7 8 10
8 10 9
10 9 12
9 12 19
12 19 22
19 22 21
>> isequal(b,c)
ans = 1
