Drop first and last column of Matrices

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Gina
Posts: 3
Joined: Sun Dec 15, 2013 5:07 am

Drop first and last column of Matrices

Postby Gina » Tue Dec 17, 2013 6:48 am

Hi, I've got the following problem: I've got about 300 matrices with different number of rows and columns. Now I want to drop the first and last column for each of them. I tried to use the following command:

matrix x_new = @subextract(maxtrix_x, 1, 2, ?, ?)

I already looked for a command, which tells EViews to use the last column each time, but I couldn't find one. Even with the @dropcol(i) I couldn't manage to solve this problem. Could you please give advice? Otherwise I would have to use the mentioned command about 300 times...
Thanks a lot in advance!

P.S.: I am using EViews 8!

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

Re: Drop first and last column of Matrices

Postby EViews Gareth » Tue Dec 17, 2013 9:08 am

Code: Select all

vector(2) drops=1 for !i=1 to 300 !cols=x!i.@cols drops(2) = !cols matrix y!i = x!i.@dropcol(drops) next
I assumed that the matrices were called X1..X300, but you can change that.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests