Changeset 290 for doc/html/mexfiles.html

Show
Ignore:
Timestamp:
03/06/09 15:03:45 (16 years ago)
Author:
smidl
Message:

correction of ARX tutorial

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/html/mexfiles.html

    r287 r290  
    22<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
    33<title>mixpp: How to write and use mex files for Matlab</title> 
     4<link href="tabs.css" rel="stylesheet" type="text/css"> 
    45<link href="doxygen.css" rel="stylesheet" type="text/css"> 
    5 <link href="tabs.css" rel="stylesheet" type="text/css"> 
    66</head><body> 
    7 <!-- Generated by Doxygen 1.5.6 --> 
     7<!-- Generated by Doxygen 1.5.8 --> 
    88<script type="text/javascript"> 
    99<!-- 
     
    5151    <ul> 
    5252      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li> 
    53       <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> 
     53      <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> 
    5454      <li><a href="modules.html"><span>Modules</span></a></li> 
    55       <li><a href="classes.html"><span>Classes</span></a></li> 
     55      <li><a href="annotated.html"><span>Classes</span></a></li> 
    5656      <li><a href="files.html"><span>Files</span></a></li> 
    5757    </ul> 
     
    7676</pre></div> on Linux, or <div class="fragment"><pre class="fragment">$ ./buildmex.bat my_mex_file.cpp 
    7777</pre></div> on Windows.<p> 
    78 Example of a mexfile: <div class="fragment"><pre class="fragment"><span class="preprocessor">#include &lt;itpp/itmex.h&gt;</span> 
    79 <span class="preprocessor">#include &lt;<a class="code" href="arx_8h.html" title="Bayesian Filtering for generalized autoregressive (ARX) model.">estim/arx.h</a>&gt;</span> 
    80  
    81 <span class="keyword">using namespace </span>bdm; 
    82  
    83 <span class="keywordtype">void</span> mexFunction(<span class="keywordtype">int</span> n_output, mxArray *output[], <span class="keywordtype">int</span> n_input, <span class="keyword">const</span> mxArray *input[]) 
    84 { 
    85     <span class="comment">// Check the number of inputs and output arguments</span> 
    86         <span class="keywordflow">if</span>(n_output!=1) mexErrMsgTxt(<span class="stringliteral">"Wrong number of output variables!"</span>); 
    87         <span class="keywordflow">if</span>(n_input!=2) mexErrMsgTxt(<span class="stringliteral">"Usage: arx1d(ysize, Data)!"</span>); 
    88  
    89     <span class="comment">// Convert input variables to IT++ format</span> 
    90         <span class="keywordtype">int</span> ysize = mxArray2int(input[0]); 
    91         mat Data = mxArray2mat(input[1]); 
    92  
    93     <span class="comment">// ------------------ Start of routine ---------------------------</span> 
    94         ARX Ar; 
    95         Ar.set_statistics(ysize, 1e-5*eye(Data.rows()) ); 
    96         Ar.bayesB(Data); 
    97         <span class="comment">// ------------------ End of routine -----------------------------</span> 
    98  
    99     <span class="comment">// Create output vectors</span> 
    100         output[0] = mxCreateDoubleMatrix(1,Data.rows(), mxREAL); 
    101  
    102     <span class="comment">// Convert the IT++ format to Matlab format for output</span> 
    103         vec2mxArray(Ar.posterior().mean(), output[0]); 
    104 } 
    105 </pre></div> </div> 
    106 <hr size="1"><address style="text-align: right;"><small>Generated on Wed Mar 4 18:50:14 2009 for mixpp by&nbsp; 
     78Example of a mexfile: <div class="fragment"><pre class="fragment"></pre></div> </div> 
     79<hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 6 15:01:37 2009 for mixpp by&nbsp; 
    10780<a href="http://www.doxygen.org/index.html"> 
    108 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> 
     81<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> 
    10982</body> 
    11083</html>