#include "mex.h"
#include <stdio.h>
#include <math.h>

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
	double *f,*out;
	double *good,*badn,*badp;
	unsigned int goodsz,badnsz,badpsz,m,n,i,x;

	goodsz=mxGetM(prhs[0]); good=mxGetPr(prhs[0]);
        badnsz=mxGetM(prhs[1]); badn=mxGetPr(prhs[1]);
        badpsz=mxGetM(prhs[2]); badp=mxGetPr(prhs[2]);

	m=mxGetM(prhs[3]); n=mxGetN(prhs[3]); f=mxGetPr(prhs[3]);
printf("%d %d\n",m,n);
printf("%f %f %f %f\n",*f,*(f+1),*(f+2),*(f+3));

	plhs[0]=mxCreateDoubleMatrix(m,n,mxREAL);
	out=mxGetPr(plhs[0]);

/*	for (i=0;i<goodsz;i++) {
		x=(int) *(good+i);
		*(out+x-1)=(*(f+x+1-1)-*(f+x-1-1))/2;
	}
	for (i=0;i<badnsz;i++) {
		x=(int) *(badn+i);
		*(out+x-1)=(*(f+x-1)*(-3)+*(f+x+1-1)*4-*(f+x+2-1))/2;
	}
	for (i=0;i<badpsz;i++) {
		x=(int) *(badp+i);
		*(out+x-1)=(*(f+x-1)*3-*(f+x-1-1)*4+*(f+x-2-1))/2;
	} */
}
