Скачиваний:
57
Добавлен:
16.04.2013
Размер:
835 б
Скачать
#include "myconv.h"
#include "myfastconv.h"

void mexFunction(int nlhs, mxArray *plhs[],
                 int nrhs, const mxArray *prhs[])
{	      
	ComplexArray x, y, u;

	if (nrhs != 2)
		mexErrMsgTxt("Two inputs required");

	if (nlhs > 1)
		mexErrMsgTxt("Too many output arguments");
	
	if ( mxGetM(prhs[0]) != 1 )
		mexErrMsgTxt("Input must be row vector");

	if ( mxGetM(prhs[1]) != 1 )
		mexErrMsgTxt("Input must be row vector");

	ComplexArrayFromMxArray(&x, prhs[0]);
	ComplexArrayFromMxArray(&y, prhs[1]);

#ifdef _MEX_CONV_
	if (!myconv(&x, &y, &u))	
#elif _MEX_FASTCONV_
	if (!myfastconv(&x, &y, &u))
#else
	mexErrMsgTxt("Recompile MEX with _MEX_CONV_ or _MEX_FASTCONV_ defined");
#endif	
		mexErrMsgTxt("Cannot allocate memory");	
	
	MxArrayFromComplexArray(&plhs[0], &u);	

	return;
}
Соседние файлы в папке fft