#include #include #include #include "libnormal.h" //This is produced later by mcc (MATLAB compiler) that translates your .m files to a library with its header. void matlab_init() { //1. Initialize MCR and library function of Matlab 7 R14. // /* Call the mclInitializeApplication routine. Make sure that the application * was initialized properly by checking the return status. This initialization * has to be done before calling any MATLAB API's or MATLAB Compiler generated * shared library functions. */ if( !mclInitializeApplication(NULL,0) ) { fprintf(stderr, "Could not initialize the application.\n"); exit(1); } /* Call the library intialization routine and make sure that the * library was initialized properly. */ if (!libnormalInitialize()){ fprintf(stderr,"Could not initialize the library.\n"); exit(1); } } int compute_normcdf(double* data_in, double* data_out, double mu, double sigma, int num) { try { // Create input data double* mus = new double[num]; double* sigmas = new double[num]; for(int i=0; i