is_scalar Basic functions lag

Grocer >> Basic functions > joinstr

joinstr

concatenation of strings and strings vectors

CALLING SEQUENCE

car=joinstr(varargin)

PARAMETERS

Input

• objects which can be strings or column vectors of strings; each vector must have the same size

Output

• car = a string

DESCRIPTION

(similar to the one with the same name in portable troll). Concatenate elements which can be strings or matrix of strings; when some arguments are vectors of string, then the function creates a string for each element of the vector by concatenating it with the arguments of size 1 (the last one notwithstanding), in the order they are given by the user; then the function concatenates these strings with the last element as a separator. Very useful, but for experts.

EXAMPLE

namex=['x1' 'x2']; namec=['a1' '(a2-a1)'];str=joinstr('namec','*','namex','+')
// returns str='a1*x1+(a2-a1)*x2'

joinstr('(',res('namex'),')*(',string(res('beta')),')+')+')'
// takes the names of variables from, say, an ols regression, multiply each name by the value of the corresponding estimated coefficient and them adds all.

AUTHOR

Eric Dubois 2002
is_scalar Basic functions lag