C アプリケーションからユーザー定義の MATLAB 関数を呼び出そうとしていますが、最も単純なエンジン シナリオでさえうまく動作しません。a = 1
以下は、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;
}