Name

eqlist — recovers objects names in an equation

CALLING SEQUENCE

[namey,ncoefeqi,lexo]=eqlist(eq,coef)

PARAMETERS

Input

• eq = a string of the form : 'varendo=coefi*varex1+…+coefj*varexk' with varexi possibly lacking

• coef = a string vector of the form coef=['coef1';…;'coefn']

Output

• namey = the name of the rhs variable

• ncoefeqi = a (nx1) vector of the indexes of coefi,…,coefj in coef

• lexo = a (nx1) vector of names of the exogenous variables

DESCRIPTION

Recovers from an equation the name of the endogenous variable, the indexes of the coefficients (in a vector) and the names of the exogenous variables (also in a vector).

EXAMPLE

1) [nyi,ncoefi,lexoi]=eqlist('y1=c1*x1+c2*x2',['c1';'c2'])
2) [grocer_nyi,grocer_ncoefi,grocer_lexoi]=eqlist(varargin(grocer_i),grocer_coef)
 
Example 1 extracts in nyi y1, in ncoefi [1;2] and in lexoi ['x1';'x2']. 
Example 2 is taken from function twosls.

               

AUTHOR

Eric Dubois 2002