Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/constructor_examples_param_content.html @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 <!-- $Id: constructor_examples_param_content.html,v 1.4 2008/04/01 12:46:21 ingo Exp $ --> | |
2 | |
3 <!-- -------------------------------------------------- --> | |
4 <!-- --------------- BEGIN CONTENT FILE --------------- --> | |
5 <!-- -------------------------------------------------- --> | |
6 | |
7 <table border="0" summary="Simple list" class="simplelist_nottable_last"> | |
8 <tr> | |
9 <td> | |
10 <a href="constructor_examples_param.html#general">General Information of the PARAM object constructor</a> | |
11 </td> | |
12 </tr> | |
13 <tr> | |
14 <td> | |
15 <a href="constructor_examples_param.html#empty">Construct empty PARAM object</a> | |
16 </td> | |
17 </tr> | |
18 <tr> | |
19 <td> | |
20 <a href="constructor_examples_param.html#xml_file">Construct a PARAM object by loading the object from a file</a> | |
21 </td> | |
22 </tr> | |
23 <tr> | |
24 <td> | |
25 <a href="constructor_examples_param.html#plist">Construct a PARAM object from a parameter list (PLIST) object</a> | |
26 </td> | |
27 </tr> | |
28 </table> | |
29 | |
30 | |
31 <!-- From parameters --> | |
32 <hr> | |
33 <h2 class="title"><a name="general"></a>General Information of the PARAM object constructor</h2> | |
34 <p> | |
35 Parameter objects are used in the LTPDA Toolbox to configure the behaviour of algorithms. A | |
36 parameter (<tt>param</tt>) object has two main properties: | |
37 <ul> | |
38 <li><tt>'key'</tt> — The parameter name</li> | |
39 <li><tt>'val'</tt> — The parameter value</li> | |
40 </ul> | |
41 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. | |
42 </p> | |
43 <p> | |
44 Parameter values can take any form: vectors or matrices of numbers; strings; other objects, | |
45 for example a <tt>specwin</tt> (spectral window) object. | |
46 </p> | |
47 <p> | |
48 Parameters are created using the <tt>param</tt> class constructor. The following code shows | |
49 how to create a parameter 'a' with a value of 1 | |
50 </p> | |
51 <div class="fragment"><pre> | |
52 >> p = param(<span class="string">'a'</span>, 1) | |
53 ---- param 1 ---- | |
54 key: a | |
55 val: 1 | |
56 ----------------- | |
57 </pre></div> | |
58 <p> | |
59 The contents of a parmeter object can be accessed as follows: | |
60 </p> | |
61 <div class="fragment"><pre> | |
62 >> key = p.key; <span class="comment">% get the parameter key</span> | |
63 >> val = p.val; <span class="comment">% get the parameter value</span> | |
64 </pre></div> | |
65 | |
66 <!-- --------------- NEXT EXAMPLE --------------- --> | |
67 | |
68 <hr> | |
69 <h2 class="title"><a name="empty"></a>Construct empty PARAM object</h2> | |
70 <p>The following example creates an empty param object</p> | |
71 <div class="fragment"><pre class="programlisting"> | |
72 p = param() | |
73 ---- param 1 ---- | |
74 key: | |
75 val: [] | |
76 ----------------- | |
77 </pre></div> | |
78 | |
79 <!-- --------------- NEXT EXAMPLE --------------- --> | |
80 | |
81 <hr> | |
82 <h2 class="title"><a name="xml_file"></a>Construct a PARAM object by loading the object from a file</h2> | |
83 <p>The following example creates a new param object by loading the param object from disk.</p> | |
84 <div class="fragment"><pre class="programlisting"> | |
85 p = param(<span class="string">'param.mat'</span>) | |
86 p = param(<span class="string">'param.xml'</span>) | |
87 </pre></div> | |
88 | |
89 <!-- --------------- NEXT EXAMPLE --------------- --> | |
90 | |
91 <hr> | |
92 <h2 class="title"><a name="plist"></a>Construct a PARAM object from a parameter list (PLIST) object</h2> | |
93 <p>To construct a PARAM object with a PLIST object it is necessarc to use the key-words 'key' and 'val'</p> | |
94 <div class="fragment"><pre class="programlisting"> | |
95 pl = plist(<span class="string">'key'</span>, <span class="string">'my_key'</span>, <span class="string">'val'</span>, <span class="string">'my_value'</span>); | |
96 | |
97 p = param(pl) | |
98 </pre></div> | |
99 | |
100 <!-- -------------------------------------------------- --> | |
101 <!-- ---------------- END CONTENT FILE ---------------- --> | |
102 <!-- -------------------------------------------------- --> |