请教:mex my_mex.c 时出错
my_mex.c程序如下:(用于矩阵乘法)/*File name:mex my_mex*/
#include "matrix.h"
void mat_ply(double *A,double *B,double *C,int m1,int n1,int m2,int n2)
{
int i,j,k,m=0;
for (i=0;i<m1;i++)
{
for (j=0;j<n2;j++)
{
C=0;
for (k=0;k<m2;k++)
{
C=A*B;
}
}
}
}
/*Interface to Matlab*/
void mexFun(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
{
double *Ap,*Bp,*Cp;
int m1,n1,m2,n2;
Ap=mxGetPr(prhs); Bp=mxGetPr(prhs);
m1=mxGetM(prhs);n1=mxGetN(prhs);
m2=mxGetM(prhs);n2=mxGetN(prhs);
prhs=mxCreateDoubleMatrix(m1,n2,mxREAL);
Cp=mxGetPr(plhs);
void mat_ply(Ap,Bp,Cp,m1,n1,m2,n2);
}
编译时,出错如下:
Error my_mex.c: 31illegal statement termination
Error my_mex.c: 31skipping `void'
2 errors, 0 warnings
D:\PROGRAM FILES\MATLAB71\BIN\MEX.PL: Error: Compile of 'my_mex.c' failed.
??? Error using ==> mex
Unable to complete successfully
不知是何缘故,我用的LCC C version2.4 作编译器。
请高手指教,谢谢!
页:
[1]