Matrix

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

vytama
Posts: 72
Joined: Wed Dec 19, 2012 11:05 am

Matrix

Postby vytama » Mon Apr 04, 2016 1:17 pm

Hello,

I have a matrix(25,127) B and a vector(1,88) C which has random numbers 1 to 127. I would like to extract columns from the matrix B Into a smaller matrix (25,88) A based on the values in the vector C. In other words, vector C has 1,2,5... 126, 127 (88 values) which indicate columns to extract from matrix B. How can I reference a vector to extract columns from matrix? Thanks

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

Re: Matrix

Postby EViews Gareth » Mon Apr 04, 2016 1:20 pm

Code: Select all

matrix newb = b.@col(c)

vytama
Posts: 72
Joined: Wed Dec 19, 2012 11:05 am

Re: Matrix

Postby vytama » Mon Apr 04, 2016 1:44 pm

Perfect. thank you.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests