Constructor examples of the PARAM class


General Information of the PARAM object constructor
Construct empty PARAM object
Construct a PARAM object by loading the object from a file
Construct a PARAM object from a parameter list (PLIST) object

General Information of the PARAM object constructor

Parameter objects are used in the LTPDA Toolbox to configure the behaviour of algorithms. A parameter (param) object has two main properties:

See param class for further details. The 'key' property is always stored in upper case. The 'value' of a parameter can be any LTPDA object, as well as most standard MATLAB types.

Parameter values can take any form: vectors or matrices of numbers; strings; other objects, for example a specwin (spectral window) object.

Parameters are created using the param class constructor. The following code shows how to create a parameter 'a' with a value of 1

	>> p = param('a', 1)
	---- param 1 ----
	key: a
	val: 1
	-----------------
  

The contents of a parmeter object can be accessed as follows:

	>> key = p.key;  % get the parameter key
	>> val = p.val;  % get the parameter value
  

Construct empty PARAM object

The following example creates an empty param object

p = param()
---- param 1 ----
key:
val: []
-----------------

Construct a PARAM object by loading the object from a file

The following example creates a new param object by loading the param object from disk.

p = param('param.mat')
p = param('param.xml')

Construct a PARAM object from a parameter list (PLIST) object

To construct a PARAM object with a PLIST object it is necessarc to use the key-words 'key' and 'val'

pl = plist('key', 'my_key', 'val', 'my_value');

p = param(pl)




©LTP Team