Page 1 of 1

Matrix

Posted: Mon Apr 04, 2016 1:17 pm
by vytama
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

Re: Matrix

Posted: Mon Apr 04, 2016 1:20 pm
by EViews Gareth

Code: Select all

matrix newb = b.@col(c)

Re: Matrix

Posted: Mon Apr 04, 2016 1:44 pm
by vytama
Perfect. thank you.