Page 1 of 1
Fill a matrix with scalars
Posted: Fri Jan 29, 2016 4:46 am
by olsisthebest
I have 100 scalars and I want to put them into a column vector.
How can I do it with a loop?
Thank you.
Re: Fill a matrix with scalars
Posted: Fri Jan 29, 2016 9:08 am
by EViews Gareth
Re: Fill a matrix with scalars
Posted: Fri Jan 29, 2016 9:39 am
by olsisthebest
Thank you, but the scalars dont have an ordinal name.
Their name do not reflect any order. Is there any alternative?
Re: Fill a matrix with scalars
Posted: Fri Jan 29, 2016 9:43 am
by EViews Gareth
Are there only those 100 scalars in the workfile, or are there other scalars too?
Re: Fill a matrix with scalars
Posted: Fri Jan 29, 2016 10:06 am
by olsisthebest
There are 300 scalars.
I want to fill 3 matrices with 3 different loops.
Why do you ask? If there was only 100 scalares the procedure will be different?
Thank you, Gareth.
Re: Fill a matrix with scalars
Posted: Fri Jan 29, 2016 10:41 am
by EViews Gareth
Well if there is no naming pattern, how do you imagine EViews will know which ones to put where? The only way to do it is to manually assign if there is no logical pattern. Note you can use
vector.fill to speed things up a little.
Re: Fill a matrix with scalars
Posted: Fri Jan 29, 2016 10:56 am
by olsisthebest
I was thinking in put the scalars name into a string and then loop over the string.
It is possible?
Re: Fill a matrix with scalars
Posted: Fri Jan 29, 2016 11:52 am
by EViews Gareth
Sure, but easier just to use fill.
Re: Fill a matrix with scalars
Posted: Mon Feb 01, 2016 8:48 am
by olsisthebest
Thank you.
It is possible to use wild cards in vector.fill argument? The scalars begin with the same letters.
Re: Fill a matrix with scalars
Posted: Mon Feb 01, 2016 8:56 am
by EViews Gareth
No.