view m-toolbox/html_help/help/ug/ltpda_training_topic_2_7.html @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

<html lang="en">
<head>
  <meta name="generator" content=
  "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
  <meta http-equiv="Content-Type" content=
  "text/html; charset=us-ascii">

  <title>Select and find data from an AO (LTPDA Toolbox)</title>
  <link rel="stylesheet" href="docstyle.css" type="text/css">
  <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
  <meta name="description" content=
  "Presents an overview of the features, system requirements, and starting the toolbox.">
  </head>

<body>
  <a name="top_of_page" id="top_of_page"></a>

  <p style="font-size:1px;">&nbsp;</p>

  <table class="nav" summary="Navigation aid" border="0" width=
  "100%" cellpadding="0" cellspacing="0">
    <tr>
      <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>

      <td valign="baseline" align="right"><a href=
      "ltpda_training_topic_2_6.html"><img src="b_prev.gif" border="0" align=
      "bottom" alt="Whitening noise"></a>&nbsp;&nbsp;&nbsp;<a href=
      "ltpda_training_topic_2_8.html"><img src="b_next.gif" border="0" align=
      "bottom" alt="Split and join AOs"></a></td>
    </tr>
  </table>

  <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Select and find data from an AO</h1>
  <hr>
  
  <p>
	
<p>
  LTPDA contains a set of methods that can be used for the selection of data from an AO. In this section
  we will in particular look at <tt>ao/find</tt> and <tt>ao/select</tt>.
</p>
<p>
  We will start by generating a sine wave:
</p>
<div class="fragment"><pre>
    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>);
    a  = ao(pl)
</pre></div>

<br>
<h2>Example 1 - using <tt>find</tt></h2>
<p>
  Now let us use the <tt>find</tt> method to extract parts of the data we are interested in.
</p>
<p>
  The <tt>find</tt> method can take a parameter 'query' for defining which data points you want to find. The
  query string can be any valid MATLAB logical expression, and in particular can be expressed in terms of the
  x and y data of the input AO. 
</p>
<p>
  In this example, we want to find all x values between 3 and 6. The following code does just that:
</p>
<div class="fragment"><pre>
    a_find = find(a, plist(<span class="string">'query'</span>, <span class="string">'x&gt;3 &amp; x&lt;6'</span>));
    iplot(a, a_find)
</pre></div>
<img src="images/ltpda_training_1/topic2/find.png" alt="find" border="1">
<br>
<h2>Example 2 - using <tt>select</tt></h2>
<p>
  The <tt>select</tt> method lets us select a set of data samples from our AO.
  For this we need a <tt>plist</tt> containing an array of samples we want to select.
  We take our sine wave again which is stored in the variable <tt>a</tt> to see how it works. 
</p>
<div class="fragment"><pre>
    a_select = select(a, plist(<span class="string">'samples'</span>, 200:800));
    iplot(a, a_select)
</pre></div>
<img src="images/ltpda_training_1/topic2/select.png" alt="select" border="1">

  </p>

  <br>
  <br>
  <table class="nav" summary="Navigation aid" border="0" width=
  "100%" cellpadding="0" cellspacing="0">
    <tr valign="top">
      <td align="left" width="20"><a href="ltpda_training_topic_2_6.html"><img src=
      "b_prev.gif" border="0" align="bottom" alt=
      "Whitening noise"></a>&nbsp;</td>

      <td align="left">Whitening noise</td>

      <td>&nbsp;</td>

      <td align="right">Split and join AOs</td>

      <td align="right" width="20"><a href=
      "ltpda_training_topic_2_8.html"><img src="b_next.gif" border="0" align=
      "bottom" alt="Split and join AOs"></a></td>
    </tr>
  </table><br>

  <p class="copy">&copy;LTP Team</p>
</body>
</html>