view m-toolbox/html_help/help/ug/builtin_models_ao_content.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

<p>
  <ul>
		<li><a href="#intro">Introduction</a></li>
		<li><a href="#available">Available models</a></li>    
		<li><a href="#new">Adding new models</a></li>
	</ul>
</p>
<h2><a name="intro">Introduction</a></h2>
<p>
  Built-in Analysis Object models provide a convenient way to add parametric
  contructors to the AO class. This is best explained with an example.
</p>
<p>
  One of the supplied built-in models is called 'whitenoise'. To see how to 
  build this model, do
</p>
<div class="fragment"><pre>
    >> help ao_model_whitenoise    
</pre></div>
<p>
  All AO model files are called <tt>ao_model_&lt;model_name&gt;</tt>.
</p>
<p>
  In this case, the help shows:
</p>
<div class="fragment"><pre>
 AO_MODEL_WHITENOISE constructs a known white-noise time-series
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  DESCRIPTION: AO_MODEL_WHITENOISE constructs a known white-noise time-series.
 
  CALL:        a = ao(plist('built-in', 'whitenoise'), pl);
 
  INPUTS:
               pl - a parameter list of additional parameters (see below)
  
  PARAMETERS:  
               'sigma' - standard deviation of the noise. [default: 1]
               'nsecs' - number of seconds [s] of data. [default: 1]
               'fs'    - sample rate [Hz] for the white noise. [default: 10]
 
 
  VERSION:     $Id: builtin_models_ao_content.html,v 1.3 2011/04/04 10:39:35 hewitson Exp $
 
  HISTORY:     29-10-08 M Hewitson
                  Creation
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
</pre></div>
<p>
  To build this model, use the following constructor:
</p>
<div class="fragment"><pre>
    a = ao(plist(<span class="string">'built-in'</span>, <span class="string">'whitenoise'</span>, <span class="string">'sigma'</span>, 2, <span class="string">'nsecs'</span>, 100, <span class="string">'fs'</span>, 10))
----------- ao 01: WN -----------
 
       name:  WN
description:  
       data: (0,0.260207192213954) (0.1,-1.01369469442225) (0.2,-2.1763634062959) (0.3,1.00632778971068) (0.4,0.523897003913847) ...
             -------- tsdata 01 ------------
              
                 fs:  10
                  x:  [1000 1], double
                  y:  [1000 1], double
             xunits:  [s]
             yunits:  [V]
              nsecs:  100
                 t0:  1970-01-01 00:00:00.000
             -------------------------------
              
       hist:  ao / ao / $Id: builtin_models_ao_content.html,v 1.3 2011/04/04 10:39:35 hewitson Exp $-->$Id: builtin_models_ao_content.html,v 1.3 2011/04/04 10:39:35 hewitson Exp $
  mfilename:  
mdlfilename:  
---------------------------------
</pre></div>
<p>
  The special thing about this model, is that it always generates noise from the same seed, thus providing a reproducible data series.
</p>

<h2><a name="available">Available models</a></h2>

<p>
  To see a list of the currently available built-in models, you can use the <tt>ao</tt> class static 
  method, <tt>getBuiltInModels</tt>:
</p>
<div class="fragment"><pre>
  >> ao.getBuiltInModels
</pre></div>
<p>
  This returns a cell-array with two columns: the first columns contains the model names; the second column descriptions of the models.
</p>
<p>
  You can also do
</p>
<div class="fragment"><pre>
    >> ao(plist(<span class="string">'built-in'</span>, <span class="string">''</span>))
</pre></div>

<h2><a name="new">Adding new models</a></h2>

<p>
  The available AO models are determined by looking through a set of directories for all M-files with names like
  <tt>ao_model_&lt;model_name&gt;</tt>. The directories to be searched depend on the installed extension modules. For more details, see
  the section on <a href="extensions_intro.html">LTPDA Extension Modules</a>.
</p>
<p>
  It is recommended to use the above 'whitenoise' model as an example when building your own models.
</p>
<p>
  To inspect the code for this model, just edit it:
</p>
<div class="fragment"><pre>
  >> edit ao_model_whitenoise
</pre></div>