Good afternoon.
I wonder if there is a way (command) to put all the elements of a matrix (row by row) into a vector without using a loop.
Example:
Matrix A = [2 3
4 5]
Vector B = [2 3 4 5]
Thanks in advance
Matrix to vector
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Matrix to vector
Use the @vech function on the transpose of the matrix.
Re: Matrix to vector
thank you Gareth.
I used @vec because I needed the complete data. @vech is only for the upper triangle of a squared matrix, but I could have not reached to that without your help. :)
I used @vec because I needed the complete data. @vech is only for the upper triangle of a squared matrix, but I could have not reached to that without your help. :)
Who is online
Users browsing this forum: No registered users and 2 guests
