gettting error in this mex file

Hello...I have this mex-matlab code and I get error when I try to debug it..The file name is pred_lt_3.c and the code is:
{
#include mex.h
#include "matrix.h"
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
{
int k,frac;
int i,j;
double *exc,*b30,*T,*fraction;
double *u1,*v;
exc=mxGetPr(prhs[0]);
T=mxGetPr(prhs[1]);
fraction=mxGetPr(prhs[2]);
b30=mxGetPr(prhs[3]);
plhs[0]=mxCreateDoubleMatrix(1,40,mxREAL);
v=mxGetPr(plhs[0]);
u1=(double *)mxCalloc(200,sizeof(double));
k=(int) T[0];
frac=(int) fraction[0];
frac=-frac;
if (frac==-1)
{
k=k+1;
frac=2;
}
for (i=0;i<200;i++)
{
u1[i]=exc[i];
}
for (i=0;i<40;i++)
{
for (j=0;j<10;j++)
{
v[i]=v[i]+u1[(i-k+160-j)]*b30[(frac+3*j)]+u1[i-k+160+j]*b30[3-frac+3*j];
u1[159+i]=v[i];
}
}
mxFree(u1);
}
}
error:??? Undefined function or method 'pred_lt_3' for input arguments of type 'double'.
Please,Can anyone solve this error? It's very urgent...

 Réponse acceptée

Matt Fig
Matt Fig le 4 Mai 2011

0 votes

Did you mex the file?
mex pred_lt_3.c
You need to mex the file before you can use it....
Also, the beginning { and ending } will cause an error, and the include mex.h is incorrect. It should be:
#include "mex.h"

Plus de réponses (0)

Catégories

En savoir plus sur Write C Functions Callable from MATLAB (MEX Files) dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by