1
我想从C应用程序中调用用户定义的MATLAB函数,但即使最简单的引擎方案工作也遇到问题。下面是一个应该简单地将a = 1
打印到MATLAB命令窗口中的程序。但是当我运行它时,没有任何反应!引擎功能:从C应用程序调用MATLAB
#include "engine.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main()
{
Engine *ep;
if (!(ep = engOpen("\0"))) {
fprintf(stderr, "\nCan't start MATLAB engine\n");
return EXIT_FAILURE;
}
engOutputBuffer(ep, NULL, 0);
engEvalString(ep, "a = 1");
engClose(ep);
return EXIT_SUCCESS;
}
当你调试你的代码时会发生什么?你看到了什么? – 2012-02-03 12:41:26
我删除了引擎和matlab标签,并把matlab引擎,这可能会让你更感兴趣的访问。 – 2012-02-03 17:56:51