copy data from table and paste in matrix

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

neptunhiker
Posts: 50
Joined: Sat Oct 20, 2012 7:30 am

copy data from table and paste in matrix

Postby neptunhiker » Sun Feb 23, 2014 11:15 pm

Hi,

I can't seem to find the solution to copy data from a table and paste it into a matrix using some program lines. Below you will find a an example workfile with a table and a matrix that is supposed to contain the data from the table.

Code: Select all

wfcreate(wf=test) u 30

series a1=@nrnd
series a2=@nrnd

group myseriesgroup a1 a2

freeze(mytable) myseriesgroup

matrix mymatrix

' How to put the data from "mytable" into "mymatrix"?
' The following line doesn't work, but that's what I want to do, i.e. put the data from "mytable" starting at row 3, column 2 and ending at row 32, column 3 into "mymatrix" at position row 1, column1.

'mymatrix(1,1)=mytable(3 2 32 3)


I tried using "copyrange", but that command only works when copying from a table to another table. The solution seems to be easy, but I can't find it. Thanks a lot for help.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13319
Joined: Tue Sep 16, 2008 5:38 pm

Re: copy data from table and paste in matrix

Postby EViews Gareth » Sun Feb 23, 2014 11:22 pm

You have to loop through the elements one at a time.
Follow us on Twitter @IHSEViews

neptunhiker
Posts: 50
Joined: Sat Oct 20, 2012 7:30 am

Re: copy data from table and paste in matrix

Postby neptunhiker » Wed Mar 26, 2014 10:37 am

Ok, thank you for your reply.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 32 guests