void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { rtsys = getrtsys() ; // Get pointer to rtsys if (rtsys==NULL) { return; } // Check number and type of arguments. if (nrhs != 2) { MEX_ERROR("ttCreateMonitor: Wrong number of input arguments!\nUsage: ttCreateMonitor(monitorname, display)"); return; } if (mxIsChar(prhs[0]) != 1) { MEX_ERROR("ttCreateMonitor: monitorname must be a string"); return; } if (!mxIsDoubleScalar(prhs[1])) { MEX_ERROR("ttCreateMonitor: display must be an integer scalar"); return; } char monitorname[100]; mxGetString(prhs[0], monitorname, 100); int display = (int) *mxGetPr(prhs[1]); if (display == 0) { ttCreateMonitor(monitorname, false); } else { ttCreateMonitor(monitorname, true); } }
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { rtsys = getrtsys() ; // Get pointer to rtsys if (rtsys==NULL) { return; } // Check number and type of arguments. if (nrhs != 1) { TT_MEX_ERROR("ttCreateMonitor: Wrong number of input arguments!\nUsage: ttCreateMonitor(monitorname)"); return; } if (mxIsChar(prhs[0]) != 1) { TT_MEX_ERROR("ttCreateMonitor: monitorname must be a string"); return; } char monitorname[MAXCHARS]; mxGetString(prhs[0], monitorname, MAXCHARS); ttCreateMonitor(monitorname); }