Page 1 of 1

Drop first and last column of Matrices

Posted: Tue Dec 17, 2013 6:48 am
by Gina
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!

Re: Drop first and last column of Matrices

Posted: Tue Dec 17, 2013 9:08 am
by EViews Gareth

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.