Question: How to simplify this writing

restart;

x := 1;

y := 3;

a := [1, 2, 3, 4, 5, 6, 7, 8, 9];

Goal is writing this matrix

Matrix([[seq(a[k], k = x .. y)], [seq(a[k], k = x+1 .. y+1)], [seq(a[k], k = x+2 .. y+2)]]);

 

when i shorten above hard code writing into this

seq(Matrix([[seq(a[k], k = x+m .. y+m)]]), m = 0 .. 2);

i failed to make a matrix, convert(,list) failed

Please Wait...