2 #include "../Mediator.h" 5 void arrayMedian(
int windowsize,
double *y,
double *z, mwSize n)
17 int nrhs,
const mxArray *prhs[])
26 mexErrMsgIdAndTxt(
"MyToolbox:arrayProduct:nrhs",
"Two inputs required.");
32 if( !mxIsDouble(prhs[0]) ||
33 mxIsComplex(prhs[0]) ||
34 mxGetNumberOfElements(prhs[0])!=1 ) {
35 mexErrMsgIdAndTxt(
"MyToolbox:arrayProduct:notScalar",
"Input multiplier must be a scalar.");
39 if( !mxIsDouble(prhs[1]) ||
40 mxIsComplex(prhs[1])) {
41 mexErrMsgIdAndTxt(
"MyToolbox:arrayProduct:notDouble",
"Input matrix must be type double.");
45 if(mxGetN(prhs[1])!=1) {
46 mexErrMsgIdAndTxt(
"MyToolbox:arrayProduct:notColVector",
"Input must be a column vector.");
50 windowsize = (int) mxGetScalar(prhs[0]);
53 inMatrix = mxGetPr(prhs[1]);
56 nrows = mxGetM(prhs[1]);
59 plhs[0] = mxCreateDoubleMatrix((mwSize)nrows,1,mxREAL);
62 outMatrix = mxGetPr(plhs[0]);
65 arrayMedian(windowsize,inMatrix,outMatrix,(mwSize)nrows);
void arrayMedian(int windowsize, double *y, double *z, mwSize n)
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])