Page 1 of 1

How to transform a matrix into a vector[series] variable

Posted: Sat Oct 27, 2007 11:12 pm
by Martin
Hi,
I have a matrix [rectangular matrix], A. I want to treat each column as a series, and transform A into a vec[ser] variable C. I encounter a problem that can be represented by the following code:

dec rec A(3,2)
comp A=||1,2|3,4|5,6||
dec vec[series] C
do i=1,2
do j=1,3
gset C(i) j j = A(j,i)
end do j
end do i

## P3. Instruction GSET Requires Parameter series
The Error Occurred At Location 0079 of loop/block
Line 2 of loop/block

Apprecitate for any comment. :)

Posted: Mon Oct 29, 2007 5:00 pm
by moderator
GSET is used to set SERIES of ARRAYS, not ARRAYS of SERIES. You just use SET for the latter. Your code should work if you

a) Remember to dimension the array C:

dec vec[series] C(2)

b) replace the GSET with SET:

set C(i) j j = A(j,i)