converting vectors to a matrix
-
Aaron
- Posts: 11
- Joined: Thu Nov 07, 2013 2:42 pm
converting vectors to a matrix
Dear All,
I would like to create a matrix and get a sub matrix from it.
For example
--------------
all 10
open data c:\temp\sample_1.xls
calendar(m) 1987:2
data(format=xls,org=obs) 1987:2 1987:11 E1 E2
com e = ||e1|e2||
pri / e
com a = %dims(e)
dis a
com ee = %xsubmat(e,1,2,1,2)
---------------
I generated a matrix with two 10 by 1 vectors so that I expect the dimension of matrix e becomes 10 by 2.
But it is not. Also matrix manipulation does not work.
How can I resolve this issue? Thank you!
I would like to create a matrix and get a sub matrix from it.
For example
--------------
all 10
open data c:\temp\sample_1.xls
calendar(m) 1987:2
data(format=xls,org=obs) 1987:2 1987:11 E1 E2
com e = ||e1|e2||
pri / e
com a = %dims(e)
dis a
com ee = %xsubmat(e,1,2,1,2)
---------------
I generated a matrix with two 10 by 1 vectors so that I expect the dimension of matrix e becomes 10 by 2.
But it is not. Also matrix manipulation does not work.
How can I resolve this issue? Thank you!
- Attachments
-
- sample_1.xls
- (25 KiB) Downloaded 784 times
-
TomDoan
- Posts: 7825
- Joined: Wed Nov 01, 2006 4:36 pm
Re: converting vectors to a matrix
Series and matrices aren't interchangeable. For what you're trying to do, it sounds like
open data c:\temp\sample_1.xls
calendar(m) 1987:2
data(format=xls,org=obs) 1987:2 1987:11 E1 E2
make ee 1 2
# e1 e2
is what you want.
open data c:\temp\sample_1.xls
calendar(m) 1987:2
data(format=xls,org=obs) 1987:2 1987:11 E1 E2
make ee 1 2
# e1 e2
is what you want.
-
Aaron
- Posts: 11
- Joined: Thu Nov 07, 2013 2:42 pm
Re: converting vectors to a matrix
I understand it now. Thank you very much!