Hi,
I am trying to call a MATLAB 2014b test script from my Visual Studio 2013 project. The project builds and runs fine without any error, but I think its not calling/executing my MATLAB script. Below is my C++ code snippet:
int main()
{
Engine *ep;
if (!(ep = engOpen(""))) {
fprintf(stderr, "\nCan't start MATLAB engine\n");
return EXIT_FAILURE;
}
engEvalString(ep, "test");
printf("Hit return to continue\n\n");
fgetc(stdin);
engClose(ep);
return EXIT_SUCCESS;
}
test.m is suppose to create a plot, but I dont see any output plot when I run this code. I thought that the MATLAB Engine is not able to find the file and hence I added the path to MATLAB path as below:
engEvalString(ep, "addpath C:\Users\Projects\MATLAB");
engEvalString(ep, "test");
But the above also doesnt show the correct result. It looks like command engEvalString is not getting executed on MATLAB.
Any thoughts?
Thanks