MATLAB: Inserting a column vector as a column in a new matrix.

arraymatrixvector

Hello,
I have a column vector (say X). And I want to make that vector as a column in my new matrix, i.e., the first column is only 1s, second column is X and third column is X^2.
Any idea as how to do it?
Thanks !!!

Best Answer

new_matrix = [1s_col X X^2]