root/applications/bdmtoolbox/mex/epdf_variance.cpp @ 796

Revision 796, 0.9 kB (checked in by smidl, 14 years ago)

UI changes for MixEF_init

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
15void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
16        // Check the number of inputs and output arguments
17        if ( n_input<1 ) mexErrMsgTxt ( "Usage:\n"
18                                                "vec=pdf_variance(pdf_struct)\n"
19                                                "  pdf_struct = struct('class','pdf_offspring',...);  % description of pdf\n"
20                                                "output:\n"
21                                                "  vec variance of given pdf." );
22
23        RV::clear_all();
24        //CONFIG
25        UImxArray Cfg(input[0]);
26        Cfg.writeFile("epdf_covariance.cfg");
27
28        shared_ptr<epdf> ep=UI::build<epdf>(Cfg);
29
30        if (ep) {
31                output[0] = mxCreateDoubleMatrix(ep->dimension(), 1, mxREAL);
32                vec2mxArray(ep->variance(), output[0]);
33        } else { 
34                mexErrMsgTxt ( "Given object is not epdf" );
35        }
36       
37}
38#endif
Note: See TracBrowser for help on using the browser.