So, I\'ve got X, a 300-by-1 vector and I\'d like [1, X, X*X, X*X*X, ... , X*X*...*X], a 300-by-twenty matrix.
How should I do this?
X=[2;1] [X,X.*X,X.*X
The element-wise power operator .^ should do what you need:
.^
x .^ (1:20)
(assuming x is a column vector.)
x