comparison m-toolbox/html_help/help/ug/constructor_examples_timespan.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 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
3
4 <html lang="en">
5 <head>
6 <meta name="generator" content=
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
8 <meta http-equiv="Content-Type" content=
9 "text/html; charset=us-ascii">
10
11 <title>Constructor examples of the TIMESPAN class (LTPDA Toolbox)</title>
12 <link rel="stylesheet" href="docstyle.css" type="text/css">
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
14 <meta name="description" content=
15 "Presents an overview of the features, system requirements, and starting the toolbox.">
16 </head>
17
18 <body>
19 <a name="top_of_page" id="top_of_page"></a>
20
21 <p style="font-size:1px;">&nbsp;</p>
22
23 <table class="nav" summary="Navigation aid" border="0" width=
24 "100%" cellpadding="0" cellspacing="0">
25 <tr>
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>
27
28 <td valign="baseline" align="right"><a href=
29 "constructor_examples_rational.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Constructor examples of the RATIONAL class"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "constructor_examples_plist.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Constructor examples of the PLIST class"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Constructor examples of the TIMESPAN class</h1>
37 <hr>
38
39 <p>
40
41 <!-- -------------------------------------------------- -->
42 <!-- --------------- BEGIN CONTENT FILE --------------- -->
43 <!-- -------------------------------------------------- -->
44
45 <!-- --------------- Link box: begin --------------- -->
46 <table border="0" summary="Simple list" class="simplelist_nottable_last">
47 <tr>
48 <td>
49 <a href="constructor_examples_timespan.html#empty">Construct empty TIMESPAN object</a>
50 </td>
51 </tr>
52 <tr>
53 <td>
54 <a href="constructor_examples_timespan.html#xml_file">Construct a TIMESPAN object by loading the object from a file</a>
55 </td>
56 </tr>
57 <tr>
58 <td>
59 <a href="constructor_examples_timespan.html#start_end">Construct a TIMESPAN object with a start and end time</a>
60 </td>
61 </tr>
62 <tr>
63 <td>
64 <a href="constructor_examples_timespan.html#plist">Construct a TIMESPAN object from a parameter list (PLIST) object</a>
65 </td>
66 </tr>
67 </table>
68 <!-- --------------- Link box: end --------------- -->
69
70 <!-- --------------- NEXT EXAMPLE --------------- -->
71
72 <hr>
73 <h2 class="title"><a name="empty"></a>Construct empty TIMESPAN object</h2>
74 <p>The following example creates an empty timespan object</p>
75 <div class="fragment"><pre class="programlisting">
76 ts = timespan()
77 ---------- timespan 01 ----------
78
79 name : None
80 start : 2008-03-30 20:00:00.000
81 end : 2008-03-30 20:00:00.000
82 timeformat: yyyy-mm-dd HH:MM:SS.FFF
83 interval :
84 timezone : UTC
85
86 created : 2008-03-30 20:00:00.000
87 version : $Id: timespan.m,v 1.23 2008/03/25 10:57:49 mauro Exp
88 plist : plist class
89 ---------------------------------
90 </pre></div>
91
92 <!-- --------------- NEXT EXAMPLE --------------- -->
93
94 <hr>
95 <h2 class="title"><a name="xml_file"></a>Construct a TIMESPAN object by loading the object from a file</h2>
96 <p>The following example creates a new timespan object by loading the timespan object from disk.</p>
97 <div class="fragment"><pre class="programlisting">
98 t = timespan(<span class="string">'timespan.mat'</span>)
99 t = timespan(<span class="string">'timespan.xml'</span>)
100 </pre></div>
101
102 <!-- --------------- NEXT EXAMPLE --------------- -->
103
104 <hr>
105 <h2 class="title"><a name="start_end"></a>Construct a TIMESPAN object with a start and end time</h2>
106 <p>It is possible to specify the start-/end- time either with a time-object or with a time string.</p>
107 <div class="fragment"><pre class="programlisting">
108 t1_obj = time(<span class="string">'14:00:00'</span>);
109 t2_obj = time(<span class="string">'15:00:00'</span>);
110 t1_str = <span class="string">'14:00:00'</span>;
111 t2_str = <span class="string">'15:00:00'</span>;
112
113 ts1 = timespan(t1_obj, t2_obj) <span class="comment">% two time-objects</span>
114 ts2 = timespan(t1_obj, t2_obj) <span class="comment">% two strings</span>
115 ts3 = timespan(t1_str, t2_obj) <span class="comment">% combination of time-object and string</span>
116 ts4 = timespan(t1_str, t2_str) <span class="comment">% combination of time-object and string</span>
117 </pre></div>
118
119
120 <!-- --------------- NEXT EXAMPLE --------------- -->
121
122 <hr>
123 <h2 class="title"><a name="plist"></a>Construct a TIMESPAN object from a parameter list (PLIST) object</h2>
124 <p>Construct an TIMESPAN by its properties definition
125 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%">
126 <tr valign="top">
127 <td width="25%">
128 <p>'start'</p>
129 </td>
130 <td width="75%">
131 <p>The starting time<br />[default: '1970-01-01 00:30:00.000']</p>
132 </td>
133 </tr>
134 <tr valign="top">
135 <td width="25%">
136 <p>'end'</p>
137 </td>
138 <td width="75%">
139 <p>The ending time<br />[default: '1980-01-01 12:00:00.010']</p>
140 </td>
141 </tr>
142 </table>
143 </p>
144 <p>Additional parameters:
145 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%">
146 <tr valign="top">
147 <td width="25%">
148 <p>'timezone'</p>
149 </td>
150 <td width="75%">
151 <p>Timezone (string or java object) [default: 'UTC']</p>
152 </td>
153 </tr>
154 <tr valign="top">
155 <td width="25%">
156 <p>'timeformat'</p>
157 </td>
158 <td width="75%">
159 <p>Time format (string) [default: 'yyyy-mm-dd HH:MM:SS.FFF']</p>
160 </td>
161 </tr>
162 </table>
163 </p>
164 <div class="fragment"><pre class="programlisting">
165 t1 = time(<span class="string">'14:00:00'</span>);
166 t2 = time(<span class="string">'15:00:00'</span>);
167
168 pl1 = plist(<span class="string">'start'</span>, t1, ...
169 <span class="string">'end'</span>, t2);
170 pl2 = plist(<span class="string">'start'</span>, t1, ...
171 <span class="string">'end'</span>, t2, ...
172 <span class="string">'timeformat'</span>, <span class="string">'yyyy-mm-dd HH:MM:SS'</span>, ...
173 <span class="string">'timezone'</span>, <span class="string">'CET'</span>);
174
175 ts1 = timespan(pl1)
176 ts2 = timespan(pl2)
177 </pre></div>
178
179
180
181 <!-- ------------------------------------------------ -->
182 <!-- --------------- END CONTENT FILE --------------- -->
183 <!-- ------------------------------------------------ -->
184
185 </p>
186
187 <br>
188 <br>
189 <table class="nav" summary="Navigation aid" border="0" width=
190 "100%" cellpadding="0" cellspacing="0">
191 <tr valign="top">
192 <td align="left" width="20"><a href="constructor_examples_rational.html"><img src=
193 "b_prev.gif" border="0" align="bottom" alt=
194 "Constructor examples of the RATIONAL class"></a>&nbsp;</td>
195
196 <td align="left">Constructor examples of the RATIONAL class</td>
197
198 <td>&nbsp;</td>
199
200 <td align="right">Constructor examples of the PLIST class</td>
201
202 <td align="right" width="20"><a href=
203 "constructor_examples_plist.html"><img src="b_next.gif" border="0" align=
204 "bottom" alt="Constructor examples of the PLIST class"></a></td>
205 </tr>
206 </table><br>
207
208 <p class="copy">&copy;LTP Team</p>
209 </body>
210 </html>