![]() |
求助:matlab神经网络与c混合编程问题
我源程序如下:
#define inputNum 7 #define outputNum 2 #define hiddenNum inputNum*2+1 int main() { int i=0,j; float input[inputNum]={1,2,4,5,6,7,4}; mxArray *result=NULL,*A=NULL; char buffer[1001]; char *str; Engine *ep; if (! (ep=engOpen (NULL)))//启动Matlab引擎 { cout<<"不能启动MATLAB引擎"<<endl; exit (-1); } A= mxCreateDoubleMatrix(1, inputNum, mxREAL); memcpy((char *) mxGetPr(A), (char *) input, inputNum*sizeof(double)); engOutputBuffer(ep, buffer, 1000); engEvalString(ep,"load('bptest.mat','-mat');"); engEvalString(ep,"y=sim(Net,A');"); result=engGetVariable(ep,"y"); double *output=mxGetPr(result); engClose (ep);//关闭引擎 mxDestroyArray (A); return 0; } 不知道是哪儿的问题,不知道A的值有没有传到工作空间中,请高手指点啊:lovely: ! |
所有时间均为北京时间。现在的时间是 06:24。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.