Fill matrix with vector

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

tinka
Posts: 5
Joined: Mon Feb 02, 2015 10:23 am

Fill matrix with vector

Postby tinka » Mon Feb 02, 2015 10:39 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13585
Joined: Tue Sep 16, 2008 5:38 pm

Re: Fill matrix with vector

Postby EViews Gareth » Mon Feb 02, 2015 11:26 am

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.

tinka
Posts: 5
Joined: Mon Feb 02, 2015 10:23 am

Re: Fill matrix with vector

Postby tinka » Tue Feb 03, 2015 2:27 am

Thanks a lot.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests