root/applications/bdmtoolbox/mex/epdf_mean.cpp @ 801

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

disable debug write to disc

Line 
1/*!
2\file
3\brief wrapper function for epdf.mean()
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_mean(pdf_struct)\n"
19                                                "  pdf_struct = struct('class','pdf_offspring',...);  % description of pdf\n"
20                                                "output:\n"
21                                                "  vec mean value of given pdf." );
22
23        RV::clear_all();
24        //CONFIG
25        UImxArray Cfg(input[0]);
26//      Cfg.writeFile("epdf_mean.cfg");
27
28        shared_ptr<epdf> ep=UI::build<epdf>(Cfg);
29       
30        if (ep){       
31                //if ( n_output<1 ) mexErrMsgTxt ( "No output - nothing to do!" );
32                output[0] = mxCreateDoubleMatrix(ep->dimension(), 1, mxREAL);
33                vec2mxArray(ep->mean(), output[0]);
34        } else { 
35                mexErrMsgTxt ( "Given object is not epdf" );
36        }
37}
38#endif
Note: See TracBrowser for help on using the browser.