$LastChangedDate: 27-Juil-2011 $

# CL_defParam

Definition of parameter structure for CL_inputParam

## Calling Sequence

       [par] = CL_defParam(text, val, id, units, dim, typ, accv, valid)

## Description

- Defines a parameter structure.

  Note: All the arguments are optional!

## Parameters

text:

  Text defining the parameter. Empty string by default.

val:

  Initial value (given in internal unit). 0 or ' ' (empty string) by default.

id:

  Identifier (string) useable in the 'valid' expression. Empty string by default.

units:

  [unit1, [unit2]] (strings), where unit1 is the internal unit (unit of val), and unit2 the unit used for input (unit2is the same as unit1 by default). By default: no units. If unit2 is defined, CL_unitConvert is used to convert from unit1 to unit2.

dim:

  Number of expected values. Default is 1. A value of -1 means 'any number including 0' (vector).

typ:

  Type of parameter: 'r' (real) only is handled (default).

accv:

  Vector (1xN) of accepted values. By default: [], meaning that everything is accepted. NB: if units are defined, values in accv must be expressed in 'input' units (i.e. unit2).

valid:

  Expression (string) used to check the validity of the value. The expression used should be compatible with 'find' if many values are expected (i.e. if dim <> 1). NB: if units are defined, the values are checked while expressed in 'input' unit(i.e unit2), not internal unit.

par:

  Parameter structure.

## Authors

- CNES - DCT/SB (AL)

## See also

- CL_inputParam

## Examples

    par=CL_defParam("param 1", val=1, accv=1:10);

    par=CL_defParam("param 2", val=[1,2], ..
    units=['m', 'km'], valid='$x == round($x)', dim=-1);

    par=CL_defParam("param 3",val=2000,units=['m', 'km']);