0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 1
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 2 <p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 3 Parameter objects are used in the LTPDA Toolbox to configure the behaviour of algorithms. A
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 4 parameter (<tt>param</tt>) object has two main properties:
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 5 <ul>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 6 <li><tt>'key'</tt> — The parameter name</li>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 7 <li><tt>'val'</tt> — The parameter value</li>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 8 </ul>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 9 See <a href="class_desc_param.html">param class</a> 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.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 10 </p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 11 <p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 12 Parameter values can take any form: vectors or matrices of numbers; strings; other objects,
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 13 for example a <tt>specwin</tt> (spectral window) object.
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 14 </p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 15 <p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 16 Parameters are created using the <tt>param</tt> class constructor. The following code shows
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 17 how to create a parameter 'a' with a value of 1
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 18 </p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 19 <div class="fragment"><pre>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 20 >> p = param(<span class="string">'a'</span>, 1)
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 21 ---- param 1 ----
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 22 key: a
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 23 val: 1
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 24 -----------------
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 25 </pre></div>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 26 <p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 27 The contents of a parmeter object can be accessed as follows:
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 28 </p>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 29 <div class="fragment"><pre>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 30 >> key = p.key; <span class="comment">% get the parameter key</span>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 31 >> val = p.val; <span class="comment">% get the parameter value</span>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 32 </pre></div>
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
+ − 33