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
Use power. It raises something to the power of y, and repeats if y is a vector.
power(x,1:300)
edit: power and .^ operator are equivalent.