root/applications/bdmtoolbox/mex/epdf_covariance.cpp @ 937

Revision 937, 1.0 kB (checked in by smidl, 14 years ago)

matlab class extension for pdf

Line 
1/*!
2\file
3\brief wrapper function for epdf.covariance()
4
5
6 */
7
8#include <stat/emix.h>
9
10using namespace bdm;
11
12#ifdef MEX
13#include <mex/mex_parser.h>
14#include "mexPdf.h"
15
16void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
17        // Check the number of inputs and output arguments
18        if ( n_input<1 ) mexErrMsgTxt ( "Usage:\n"
19                                                "vec=pdf_variance(pdf_struct)\n"
20                                                "  pdf_struct = struct('class','pdf_offspring',...);  % description of pdf\n"
21                                                "output:\n"
22                                                "  vec variance of given pdf." );
23
24        RV::clear_all();
25        //CONFIG
26        UImxArray Cfg(input[0]);
27//      Cfg.writeFile("epdf_covariance.cfg");
28
29        shared_ptr<epdf> ep=UI::build<epdf>(Cfg);
30
31        if (ep) {
32                output[0] = mxCreateDoubleMatrix(ep->dimension(), ep->dimension(), mxREAL);
33                mat2mxArray(ep->covariance(), output[0]);
34        } else { 
35                mexErrMsgTxt ( "Given object is not epdf" );
36        }
37       
38}
39#endif
Note: See TracBrowser for help on using the browser.