#include #include using namespace bdm; class mexEpdf: public epdf{ protected: string name; vec S; //bude struktura mxArray public: mexEpdf(){}; void set(const string name0, const vec &S0){name=name0; S=S0;} // vola fci name+"new" a preda ji mxArray misto S vec mean() const {return S;} //bude vysledek volani fce matlabu }; class mexBM: public BM{ protected : string name; mexEpdf est; public: mexBM(string name0){name=name0;est.set("mexEpdf",vec_1(1.2));} void bayes(const vec &dt){/* volej matlab name+"_bayes" */} const mexEpdf& posterior()const{return est;} //tohle by melo zustat!! const mexEpdf* _e()const{return &est;} //tohle by melo zustat!! }; 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("Wrong number of input variables - expected parameter 'name'!"); // ------------------ Start of routine --------------------------- mexBM mB(mxArray2string(input[0])); // naplni mB.bayes(vec_1(1.3)); // ------------------ End of routine ----------------------------- // Create output vectors output[0] = mxCreateDoubleMatrix(1,1, mxREAL); // Convert the IT++ format to Matlab format for output vec2mxArray(mB.posterior().mean(), output[0]); }