view m-toolbox/html_help/help/ug/ltpda_training_topic_1_7.html @ 48:16aa66670d74
database-connection-manager
Fix LTPDA Preferences tooltip
author |
Daniele Nicolodi <nicolodi@science.unitn.it> |
date |
Tue, 06 Dec 2011 19:07:27 +0100 (2011-12-06) |
parents |
f0afece42f48 |
children |
|
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>Writing LTPDA scripts (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;"> </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_1_6.html"><img src="b_prev.gif" border="0" align=
"bottom" alt="Constructing AOs from data files"></a> <a href=
"ltpda_training_topic_1_9.html"><img src="b_next.gif" border="0" align=
"bottom" alt="IFO/Temperature Example - Introduction"></a></td>
</tr>
</table>
<h1 class="title"><a name="f3-12899" id="f3-12899"></a>Writing LTPDA scripts</h1>
<hr>
<p>
<p>
Up to now, all the activity of the tutorial has been carried out on the MATLAB
command terminal. It is, of course, much more convenient to collect the commands
together in to a MATLAB script. In this sense, LTPDA scripting is just the same
as normal MATLAB scripting; just using LTPDA commands.
</p>
Here's an example script which makes two white-noise time-series and estimated the
power-spectral-density of each.
</p>
<div class="fragment"><pre>
<span class="comment">%% Make two test AOs</span>
a1 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, 10, <span class="string">'nsecs'</span>, 100));
a2 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, 10, <span class="string">'nsecs'</span>, 100));
<span class="comment">%% Make TFE</span>
psds = psd(a1, a1);
a1xx = psds(1);
a2xx = psds(2);
<span class="comment">% The following works!.</span>
b1xx = psd(a1);
b2xx = psd(a2);
</pre></div>
<p>
You can explore the commands used to rebuild the object by using the <tt>type</tt>
method. Or you can plot the history as we did earlier. For example, try this command
for each of the cases above:
</p>
<div class="fragment"><pre>
type(a1xx)
type(b1xx)
</pre></div>
</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_1_6.html"><img src=
"b_prev.gif" border="0" align="bottom" alt=
"Constructing AOs from data files"></a> </td>
<td align="left">Constructing AOs from data files</td>
<td> </td>
<td align="right">IFO/Temperature Example - Introduction</td>
<td align="right" width="20"><a href=
"ltpda_training_topic_1_9.html"><img src="b_next.gif" border="0" align=
"bottom" alt="IFO/Temperature Example - Introduction"></a></td>
</tr>
</table><br>
<p class="copy">©LTP Team</p>
</body>
</html>