Mercurial > hg > ltpda
view m-toolbox/html_help/help/ug/constructor_examples_param_content.html @ 41:6def6533cb16 database-connection-manager
Report authentication errors to user
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 18:04:34 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
<!-- $Id: constructor_examples_param_content.html,v 1.4 2008/04/01 12:46:21 ingo Exp $ --> <!-- -------------------------------------------------- --> <!-- --------------- BEGIN CONTENT FILE --------------- --> <!-- -------------------------------------------------- --> <table border="0" summary="Simple list" class="simplelist_nottable_last"> <tr> <td> <a href="constructor_examples_param.html#general">General Information of the PARAM object constructor</a> </td> </tr> <tr> <td> <a href="constructor_examples_param.html#empty">Construct empty PARAM object</a> </td> </tr> <tr> <td> <a href="constructor_examples_param.html#xml_file">Construct a PARAM object by loading the object from a file</a> </td> </tr> <tr> <td> <a href="constructor_examples_param.html#plist">Construct a PARAM object from a parameter list (PLIST) object</a> </td> </tr> </table> <!-- From parameters --> <hr> <h2 class="title"><a name="general"></a>General Information of the PARAM object constructor</h2> <p> Parameter objects are used in the LTPDA Toolbox to configure the behaviour of algorithms. A parameter (<tt>param</tt>) object has two main properties: <ul> <li><tt>'key'</tt> — The parameter name</li> <li><tt>'val'</tt> — The parameter value</li> </ul> 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. </p> <p> Parameter values can take any form: vectors or matrices of numbers; strings; other objects, for example a <tt>specwin</tt> (spectral window) object. </p> <p> Parameters are created using the <tt>param</tt> class constructor. The following code shows how to create a parameter 'a' with a value of 1 </p> <div class="fragment"><pre> >> p = param(<span class="string">'a'</span>, 1) ---- param 1 ---- key: a val: 1 ----------------- </pre></div> <p> The contents of a parmeter object can be accessed as follows: </p> <div class="fragment"><pre> >> key = p.key; <span class="comment">% get the parameter key</span> >> val = p.val; <span class="comment">% get the parameter value</span> </pre></div> <!-- --------------- NEXT EXAMPLE --------------- --> <hr> <h2 class="title"><a name="empty"></a>Construct empty PARAM object</h2> <p>The following example creates an empty param object</p> <div class="fragment"><pre class="programlisting"> p = param() ---- param 1 ---- key: val: [] ----------------- </pre></div> <!-- --------------- NEXT EXAMPLE --------------- --> <hr> <h2 class="title"><a name="xml_file"></a>Construct a PARAM object by loading the object from a file</h2> <p>The following example creates a new param object by loading the param object from disk.</p> <div class="fragment"><pre class="programlisting"> p = param(<span class="string">'param.mat'</span>) p = param(<span class="string">'param.xml'</span>) </pre></div> <!-- --------------- NEXT EXAMPLE --------------- --> <hr> <h2 class="title"><a name="plist"></a>Construct a PARAM object from a parameter list (PLIST) object</h2> <p>To construct a PARAM object with a PLIST object it is necessarc to use the key-words 'key' and 'val'</p> <div class="fragment"><pre class="programlisting"> pl = plist(<span class="string">'key'</span>, <span class="string">'my_key'</span>, <span class="string">'val'</span>, <span class="string">'my_value'</span>); p = param(pl) </pre></div> <!-- -------------------------------------------------- --> <!-- ---------------- END CONTENT FILE ---------------- --> <!-- -------------------------------------------------- -->