/*! \file \brief wrapper function for epdf.mean() */ #include using namespace bdm; #ifdef MEX #include #include void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { // Check the number of inputs and output arguments if ( n_input<1 ) mexErrMsgTxt ( "Usage:\n" "vec=pdf_mean(pdf_struct)\n" " pdf_struct = struct('class','pdf_offspring',...); % description of pdf\n" "output:\n" " vec mean value of given pdf." ); RV::clear_all(); //CONFIG UImxArray Cfg(input[0]); Cfg.writeFile("epdf_mean.cfg"); shared_ptr ep=UI::build(Cfg); if (ep){ //if ( n_output<1 ) mexErrMsgTxt ( "No output - nothing to do!" ); output[0] = mxCreateDoubleMatrix(ep->dimension(), 1, mxREAL); vec2mxArray(ep->mean(), output[0]); } else { mexErrMsgTxt ( "Given object is not epdf" ); } } #endif