In MATLAB I have a vector x of length n, where n is usually O(10), and I would like to build a tall matrix A of size [n^m,m], where m is again 0(10). The matrix has a peculiar form: if n=4 and m=6, let
x=[x1; x2; x3; x4]
then A is
x1 x1 x1 x1 x1 x1
x2 x1 x1 x1 x1 x1
x3 x1 x1 x1 x1 x1
x4 x1 x1 x1 x1 x1
x1 x2 x1 x1 x1 x1
x2 x2 x1 x1 x1 x1
x3 x2 x1 x1 x1 x1
x4 x2 x1 x1 x1 x1
x1 x3 x2 x1 x1 x1
. .
. .
. .
x4 x4 x4 x4 x4 x4
In practice, each column is obtained by repeating the elements of x, with an increasing stride for each column. How can I do that? If possible, I'd prefer an efficient (vectorized) solution, because, as you can see, the number of rows of A increases exponentially with m.
EDIT: whoops, sorry! I forgot I also need to build a vector V of size [n^m,1], based on vector w having the same length of x
w=[w1; w2; w3; w4]
V is
w1^6
w2*w1^5
w3*w1^5
.
.
.
w4^6
Hope the crappy graphics is clear enough. Anyway, V is a column vector of lenght n^m. Guess I could create a matrix B from w, in the same way one creates a matrix A from x, and then use prod(B,2)?