Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/ltpda_training_topic_2_7.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>Select and find data from an AO (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;"> </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 "ltpda_training_topic_2_6.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="Whitening noise"></a> <a href= | |
31 "ltpda_training_topic_2_8.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Split and join AOs"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Select and find data from an AO</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 | |
41 <p> | |
42 LTPDA contains a set of methods that can be used for the selection of data from an AO. In this section | |
43 we will in particular look at <tt>ao/find</tt> and <tt>ao/select</tt>. | |
44 </p> | |
45 <p> | |
46 We will start by generating a sine wave: | |
47 </p> | |
48 <div class="fragment"><pre> | |
49 pl = plist(<span class="string">'waveform'</span>, <span class="string">'sine wave'</span>, <span class="string">'f'</span>, 1, <span class="string">'fs'</span>, 100, <span class="string">'nsecs'</span>, 10, <span class="string">'yunits'</span>, <span class="string">'V'</span>); | |
50 a = ao(pl) | |
51 </pre></div> | |
52 | |
53 <br> | |
54 <h2>Example 1 - using <tt>find</tt></h2> | |
55 <p> | |
56 Now let us use the <tt>find</tt> method to extract parts of the data we are interested in. | |
57 </p> | |
58 <p> | |
59 The <tt>find</tt> method can take a parameter 'query' for defining which data points you want to find. The | |
60 query string can be any valid MATLAB logical expression, and in particular can be expressed in terms of the | |
61 x and y data of the input AO. | |
62 </p> | |
63 <p> | |
64 In this example, we want to find all x values between 3 and 6. The following code does just that: | |
65 </p> | |
66 <div class="fragment"><pre> | |
67 a_find = find(a, plist(<span class="string">'query'</span>, <span class="string">'x>3 & x<6'</span>)); | |
68 iplot(a, a_find) | |
69 </pre></div> | |
70 <img src="images/ltpda_training_1/topic2/find.png" alt="find" border="1"> | |
71 <br> | |
72 <h2>Example 2 - using <tt>select</tt></h2> | |
73 <p> | |
74 The <tt>select</tt> method lets us select a set of data samples from our AO. | |
75 For this we need a <tt>plist</tt> containing an array of samples we want to select. | |
76 We take our sine wave again which is stored in the variable <tt>a</tt> to see how it works. | |
77 </p> | |
78 <div class="fragment"><pre> | |
79 a_select = select(a, plist(<span class="string">'samples'</span>, 200:800)); | |
80 iplot(a, a_select) | |
81 </pre></div> | |
82 <img src="images/ltpda_training_1/topic2/select.png" alt="select" border="1"> | |
83 | |
84 </p> | |
85 | |
86 <br> | |
87 <br> | |
88 <table class="nav" summary="Navigation aid" border="0" width= | |
89 "100%" cellpadding="0" cellspacing="0"> | |
90 <tr valign="top"> | |
91 <td align="left" width="20"><a href="ltpda_training_topic_2_6.html"><img src= | |
92 "b_prev.gif" border="0" align="bottom" alt= | |
93 "Whitening noise"></a> </td> | |
94 | |
95 <td align="left">Whitening noise</td> | |
96 | |
97 <td> </td> | |
98 | |
99 <td align="right">Split and join AOs</td> | |
100 | |
101 <td align="right" width="20"><a href= | |
102 "ltpda_training_topic_2_8.html"><img src="b_next.gif" border="0" align= | |
103 "bottom" alt="Split and join AOs"></a></td> | |
104 </tr> | |
105 </table><br> | |
106 | |
107 <p class="copy">©LTP Team</p> | |
108 </body> | |
109 </html> |