Page 1 of 1

Fill matrix with vector

Posted: Mon Feb 02, 2015 10:39 am
by tinka
Is there a simple command I can place a rowvector(n) in the rows of a matrix(m,n) and appending the vector by a 0 for each row. To be more precise, I want to create a matrix
[a b c
0 a b
0 0 a]
from a vector [a b c].
Thanks a lot in advance.

Re: Fill matrix with vector

Posted: Mon Feb 02, 2015 11:26 am
by EViews Gareth
I think I would create a matrix that has too many columns, then use matplace to insert the row vector in full one row at a time. Then use matrix.dropcol to lop off the extra columns.

Re: Fill matrix with vector

Posted: Tue Feb 03, 2015 2:27 am
by tinka
Thanks a lot.