0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 <!-- $Id: constructor_examples_rational_content.html,v 1.1 2009/02/27 16:51:57 ingo Exp $ -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 <!-- -------------------------------------------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 <!-- --------------- BEGIN CONTENT FILE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 <!-- -------------------------------------------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 <!-- --------------- Link box: begin --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 <table border="0" summary="Simple list" class="simplelist_nottable_last">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 <a href="constructor_examples_rational.html#copy">Copy an rational object</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 <a href="constructor_examples_rational.html#xml_file">Construct an rational object by loading the object from a file</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 <a href="constructor_examples_rational.html#rational">Construct an rational object from an parfrac object</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 <a href="constructor_examples_rational.html#pzmodel">Construct an rational object from a pole/zero model</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 <a href="constructor_examples_rational.html#coeffs">Construct an rational object from numerator and denominator coefficients</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 <a href="constructor_examples_rational.html#plist">Construct an rational object from a parameter list object (PLIST)</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 </table>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 <h2 class="title"><a name="copy"></a>Copy an rational object</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 <p>The following example creates a copy of an rational object (blue command).</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 >> ra1 = rational([1 2 3], [4 5 6 7], <span class="string">'my rational'</span>);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 <span class="blue">>> ra2 = rational(ra1)</span>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 model: my rational
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 num: [1 2 3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 den: [4 5 6 7]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 <br></br>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 <p>REMARK: The following command copies only the handle of an object and doesn't create a copy of the object (as above). This means that everything that happens to the copy or original happens to the other object.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 >> ra1 = rational()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 model: none
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 num: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 den: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 >> ra2 = ra1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 >> ra2.setName(<span class="string">'my new name'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 model: <span class="string">my new name</span>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 num: [1 2 3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 den: [4 5 6 7]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 <br></br>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 <p>If we display ra1 again then we see that the property 'name' was changed although we only have changed ra2.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 >> ra1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 model: <span class="string">my new name</span>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 num: [1 2 3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 den: [4 5 6 7]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 <h2 class="title"><a name="xml_file"></a>Construct an rational object by loading the object from a file</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 <p>The following example creates a new rational object by loading the object from disk.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 ra = rational(<span class="string">'rational_object.mat'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 ra = rational(<span class="string">'rational_object.xml'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 <p>or in a <tt>PLIST</tt></p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 pl = plist(<span class="string">'filename'</span>, <span class="string">'rational_object.xml'</span>);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105 ra = rational(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 <h2 class="title"><a name="rational"></a>Construct an rational object from an parfrac object</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 <p>The following example creates a new rational object from an parfrac object.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 >> pf = parfrac([1 2+1i 2-1i], [6 1+3i 1-3i], 3, <span class="string">'my parfrac'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 ---- parfrac 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 model: my parfrac
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 res: [1;2+i*1;2-i*1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 poles: [6;1+i*3;1-i*3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 dir: 3
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 pmul: [1;1;1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 -------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125 >> ra = rational(pf)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 model: rational(my parfrac)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128 num: [3 -19 30 -110]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129 den: [1 -8 22 -60]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 <p>or in a plist</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 >> pf = parfrac([1 2+1i 2-1i], [6 1+3i 1-3i], 3, <span class="string">'my parfrac'</span>);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 >> pl = plist(<span class="string">'rational'</span>, rat)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 >> ra = rational(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145 <h2 class="title"><a name="pzmodel"></a>Construct an rational object from a pole/zero model</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 <p>The following example creates a new rational object from a pole/zero model.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148 >> pzm = pzmodel(1, {1 2 3}, {4 5}, <span class="string">'my pzmodel'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 ---- pzmodel 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150 name: my pzmodel
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 gain: 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152 delay: 0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155 pole 001: (f=1 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 pole 002: (f=2 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 pole 003: (f=3 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158 zero 001: (f=4 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 zero 002: (f=5 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 -------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161 >> ra = rational(pzm)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 model: rational(None)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 num: [0.0012 0.0716 1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 den: [0.0001 0.0036 0.0401 0.2122 1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 <p>or in a plist</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172 >> pzm = pzmodel(1, {1 2 3}, {4 5}, <span class="string">'my pzmodel'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173 >> pl = plist(<span class="string">'pzmodel'</span>, pzm)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174 >> ra = rational(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181 <h2 class="title"><a name="coeffs"></a>Construct an rational object from numerator and denominator coefficients</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182 <p>The following example creates a new rational direct from the numerator and denominator coefficients.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 >> num = [1 2 3];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185 >> den = [4 5 6];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 >> name = <span class="string">'my rational'</span>;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 >> iunits = <span class="string">'Hz'</span>;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 >> ounits = <span class="string">'V'</span>;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190 >> ra = rational(num, den)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191 >> ra = rational(num, den, name)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192 >> ra = rational(num, den, name, iunits, ounits)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194 model: my rational
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 num: [1 2 3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196 den: [4 5 6]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 iunits: [Hz]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 ounits: [V]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
205 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
206 <h2 class="title"><a name="plist"></a>Construct an rational object from a parameter list (<tt>plist</tt>)</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
207 <p>Constructs an rational object from the description given in the parameter list.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
208
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
209 <!-- --------------- Link box: begin --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
210 <table border="0" summary="Simple list" class="simplelist_nottable_last">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
211 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
212 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
213 <a href="constructor_examples_rational.html#hostname">Use the key word 'hostname'</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
214 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
215 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
216 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
217 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
218 <a href="constructor_examples_rational.html#pl_coeffs">Use the key word 'num' or 'den'</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
219 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
220 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
221 </table>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
222 <!-- --------------- Link box: end --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
223
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
224
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
225 <!-- --------------- 'hostname' --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
226
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
227 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
228 <h3 class="title"><a name="hostname"></a>Use the key word 'hostname'</h3>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
229 <p>Construct an rational object by retrieving it from a LTPDA repository.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
230 <p>The relevant parameters are:</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
231 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
232 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
233 <colgroup>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
234 <col width="25%"/>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
235 <col width="75%"/>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
236 </colgroup>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
237 <thead>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
238 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
239 <th class="subcategorylist">Key</th>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
240 <th class="subcategorylist">Description</th>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
241 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
242 </thead>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
243 <tbody>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
244 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
245 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
246 <p>'hostname'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
247 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
248 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
249 <p>the repository hostname. [default: 'localhost']</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
250 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
251 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
252 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
253 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
254 <p>'database'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
255 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
256 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
257 <p>The database name [default: 'ltpda']</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
258 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
259 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
260 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
261 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
262 <p>'id'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
263 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
264 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
265 <p>A vector of object IDs. [default: []]</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
266 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
267 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
268 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
269 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
270 <p>'cid'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
271 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
272 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
273 <p>Retrieve all rational objects from a particular collection</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
274 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
275 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
276 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
277 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
278 <p>'binary'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
279 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
280 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
281 <p>Set to 'yes' to retrieve from stored binary representation (not always available). [default: yes]</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
282 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
283 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
284 </tbody>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
285 </table>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
286 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
287 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
288 pl = plist(<span class="string">'hostname'</span>, <span class="string">'130.75.117.67'</span>, <span class="string">'database'</span>, <span class="string">'ltpda_test'</span>, <span class="string">'id'</span>, 1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
289 a1 = rational(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
290 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
291
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
292
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
293 <!-- --------------- 'direct_terms' --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
294
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
295 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
296 <h3 class="title"><a name="direct_terms"></a>Use the key word 'num' or 'den'</h3>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
297 <p>Construct an rational object direct from the coefficients.<br></br>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
298 The relevant parameters are:</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
299 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
300 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
301 <colgroup>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
302 <col width="25%"/>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
303 <col width="75%"/>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
304 </colgroup>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
305 <thead>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
306 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
307 <th class="subcategorylist">Key</th>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
308 <th class="subcategorylist">Description</th>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
309 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
310 </thead>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
311 <tbody>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
312 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
313 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
314 <p>'num'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
315 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
316 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
317 <p>numerator coefficients [default: []]</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
318 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
319 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
320 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
321 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
322 <p>'den'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
323 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
324 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
325 <p>denominator coefficients [default: []]</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
326 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
327 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
328 </tbody>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
329 </table>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
330 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
331 <p>You can also specify optional parameters:</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
332 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
333 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
334 <colgroup>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
335 <col width="25%"/>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
336 <col width="75%"/>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
337 </colgroup>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
338 <thead>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
339 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
340 <th class="subcategorylist">Key</th>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
341 <th class="subcategorylist">Description</th>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
342 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
343 </thead>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
344 <tbody>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
345 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
346 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
347 <p>'name'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
348 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
349 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
350 <p>name of the rational object [default: 'none']</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
351 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
352 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
353 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
354 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
355 <p>'xunits'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
356 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
357 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
358 <p>unit of the x-axis</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
359 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
360 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
361 <tr valign="top">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
362 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
363 <p>'yunits'</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
364 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
365 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
366 <p>unit of the y-axis</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
367 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
368 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
369 </tbody>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
370 </table>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
371 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
372 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
373 num = [1 2 3];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
374 den = [4 5 6];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
375 name = <span class="string">'my rational'</span>;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
376 iunits = <span class="string">'Hz'</span>;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
377 ounits = <span class="string">'V'</span>;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
378
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
379 pl = plist(<span class="string">'num'</span>, num, <span class="string">'den'</span>, den);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
380 ra = rational(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
381 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
382 model: None
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
383 num: [1 2 3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
384 den: [4 5 6]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
385 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
386 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
387 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
388
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
389 pl = plist(<span class="string">'num'</span>, num, <span class="string">'den'</span>, den, <span class="string">'name'</span>, name, <span class="string">'iunits'</span>, iunits, <span class="string">'ounits'</span>, ounits);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
390 pf = rational(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
391 ---- rational 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
392 model: my rational
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
393 num: [1 2 3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
394 den: [4 5 6]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
395 iunits: [Hz]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
396 ounits: [V]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
397 --------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
398 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
399
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
400
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
401
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
402
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
403
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
404
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
405
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
406
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
407
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
408
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
409
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
410
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
411
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
412
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
413
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
414
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
415
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
416
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
417
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
418
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
419
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
420
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
421
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
422
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
423
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
424
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
425
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
426
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
427
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
428
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
429
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
430
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
431
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
432
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
433
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
434
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
435
|