vc与matlab
请问一下有谁做过vc跟matlab的混合编程?
请指导一下
我用在用vc调用matlab引擎时,总没有结果?,就是说不会出现那个训练图出来,不知道为什么,代码如下
void CVcmatDlg::OnButton1()
{
// TODO: Add your control notification handler code here
// TODO: Add your control notification handler code here
Engine *m_ep;
if(!(m_ep=engOpen(NULL))) //打开Matlab引擎,建立与本地Matlab的连接
{
//fprintf(stderr,"\n Can't start MATLAB engine\n");
AfxMessageBox("Can't start MATLAB engine");
exit(1);
} //这个地方执行正确,也就是说引擎打开
engEvalString(m_ep,"sympin=dlmread(e:\sympin.txt',',');");
engEvalString(m_ep,"pin=sympin';");
engEvalString(m_ep,"sympout=dlmread('e:\sympout.txt',',');");
engEvalString(m_ep,"pout=sympout';");
engEvalString(m_ep,"net1=newff(minmax(pin),[16,7],{'tansig','purelin'},'trainscg');");
engEvalString(m_ep,"net1.trainParam.show=50;");
engEvalString(m_ep,"net1.trainParam.lr=0.01;");
engEvalString(m_ep,"net1.trainParam.mc=0.2;");
engEvalString(m_ep,"net1.trainParam.epochs=10000;");
engEvalString(m_ep,"net1.trainParam.goal=1e-7;");
engEvalString(m_ep,"net1=train(net1,pin,pout);");*/
engClose(m_ep);
}