Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/constructor_examples_tsdata_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_tsdata_content.html,v 1.1 2008/03/30 20:40:04 ingo Exp $ --> | |
2 | |
3 <!-- -------------------------------------------------- --> | |
4 <!-- --------------- BEGIN CONTENT FILE --------------- --> | |
5 <!-- -------------------------------------------------- --> | |
6 | |
7 <!-- --------------- Link box: begin --------------- --> | |
8 <table border="0" summary="Simple list" class="simplelist_nottable_last"> | |
9 <tr> | |
10 <td> | |
11 <a href="constructor_examples_tsdata.html#empty">Construct empty TSDATA object</a> | |
12 </td> | |
13 </tr> | |
14 <tr> | |
15 <td> | |
16 <a href="constructor_examples_tsdata.html#xml_file">Construct a TSDATA object by loading the object from a file</a> | |
17 </td> | |
18 </tr> | |
19 <tr> | |
20 <td> | |
21 <a href="constructor_examples_tsdata.html#data_vector">Construct a TSDATA object from a data vector</a> | |
22 </td> | |
23 </tr> | |
24 <tr> | |
25 <td> | |
26 <a href="constructor_examples_tsdata.html#data_freq_vector">Construct a TSDATA object from a data vector and time vector</a> | |
27 </td> | |
28 </tr> | |
29 <tr> | |
30 <td> | |
31 <a href="constructor_examples_tsdata.html#data_frequency">Construct a TSDATA object from a data vector and the corresponding frequency</a> | |
32 </td> | |
33 </tr> | |
34 </table> | |
35 <!-- --------------- Link box: end --------------- --> | |
36 | |
37 <!-- --------------- NEXT EXAMPLE --------------- --> | |
38 | |
39 <hr> | |
40 <h2 class="title"><a name="empty"></a>Construct empty TSDATA object</h2> | |
41 <p>The following example creates an empty tsdata object</p> | |
42 <div class="fragment"><pre class="programlisting"> | |
43 ts = tsdata() | |
44 -------- tsdata 01 ------------ | |
45 | |
46 name: None | |
47 fs: 0 | |
48 x: [0 0], double | |
49 y: [0 0], double | |
50 xunits: | |
51 yunits: | |
52 nsecs: 0 | |
53 t0: 1970-01-01 00:00:00.000 | |
54 ------------------------------- | |
55 </pre></div> | |
56 | |
57 <!-- --------------- NEXT EXAMPLE --------------- --> | |
58 | |
59 <hr> | |
60 <h2 class="title"><a name="xml_file"></a>Construct a TSDATA object by loading the object from a file</h2> | |
61 <p>The following example creates a new tsdata object by loading the tsdata object from disk.</p> | |
62 <div class="fragment"><pre class="programlisting"> | |
63 tsd = tsdata(<span class="string">'tsd.mat'</span>) | |
64 tsd = tsdata(<span class="string">'tsd.xml'</span>) | |
65 </pre></div> | |
66 | |
67 <!-- --------------- NEXT EXAMPLE --------------- --> | |
68 | |
69 <hr> | |
70 <h2 class="title"><a name="data_vector"></a>Construct a TSDATA object from a data vector</h2> | |
71 <p>Creates a time-series object with the given x-data. Sample rate of the data is assumed to be 1Hz.</p> | |
72 <div class="fragment"><pre class="programlisting"> | |
73 y = randn(1000,1); | |
74 | |
75 tsd = tsdata(y) | |
76 </pre></div> | |
77 | |
78 <!-- --------------- NEXT EXAMPLE --------------- --> | |
79 | |
80 <hr> | |
81 <h2 class="title"><a name="data_freq_vector"></a>Construct a TSDATA object from a data vector and time vector</h2> | |
82 <p>Creates a time-series object with the given (t,x)-data. The sample rate is then set as 1/(t(2)-t(1)).</p> | |
83 <div class="fragment"><pre class="programlisting"> | |
84 fs = 10; | |
85 x = linspace(0, fs/2, 1000); | |
86 y = randn(1000,1); | |
87 | |
88 f1 = tsdata(x,y) | |
89 </pre></div> | |
90 | |
91 <!-- --------------- NEXT EXAMPLE --------------- --> | |
92 | |
93 <hr> | |
94 <h2 class="title"><a name="data_frequency"></a>Construct a TSDATA object from a data vector and the corresponding frequency</h2> | |
95 <p>creates a time-series object with the given x-data. The time vector t[] is grown from the sample rate. The first sample is assigned time 0.</p> | |
96 <div class="fragment"><pre class="programlisting"> | |
97 y = randn(1000,1); | |
98 fs = 100; | |
99 | |
100 tsd = tsdata(y,fs) | |
101 </pre></div> | |
102 | |
103 <!-- ------------------------------------------------ --> | |
104 <!-- --------------- END CONTENT FILE --------------- --> | |
105 <!-- ------------------------------------------------ --> |