Declaration

Navigation:  Language Reference > Matrices and Vectors >

Declaration

Previous pageReturn to chapter overviewNext page

Matrices and column vectors are declared in the constants, parameters and variables sections of a model. Declaration of matrices and column vectors is equal to the declaration of scalars, the size however has to be specified explicitly using square brackets []. For example:

 

parameters

 real A[3,3], B[3,3];

 integer C[2,2] = [1,3;5,7];

 real K[4] = [1;2;3;4];

variables

 real K[4],L[4],D[4,5];

 integer M[2,2],N[2,2];

 

Matrices and Vectors can only be of the datatype real or integer.