1. 包含和库目录,还有附加依赖项都选好
2. #include<engine.h>
3. 定义Engine *ep; // matlab engine
4. 加上openEng和closeEng
void open_matEng()
{
if( !( ep = engOpen(NULL) ) )
{
fprintf(stderr, "\nCan't start MATLAB engine\n");
exit( EXIT_FAILURE );
}
engSetVisible( ep , true) ;
engEvalString( ep , "clear" ) ;
}
void close_matEng()
{
// engSetVisible(ep,false);
engEvalString(ep,"clear");
// engClose(ep);
}