Click here to Skip to main content
15,891,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to call a .m matlab programme using C for samples taking.
So far what I found in the forum are codes that call specific functions of matlab in matlab library instead of calling the entire .m matlab programme.

Actually I had problem in the very first step when I set the environment
I typed

XML
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "engine.h"
int main()
{
Engine *ep= engOpen(NULL);
engEvalString(ep,"testplot");
engClose(ep);
return(0);
}


//where testplot is a .m file.
//It shows

<pre lang="vb">1&gt;test.obj : error LNK2019: unresolved external symbol _engClose referenced in function _main
1&gt;test.obj : error LNK2019: unresolved external symbol _engEvalString referenced in function _main
1&gt;test.obj : error LNK2019: unresolved external symbol _engOpen referenced in function _main</pre>



Many thanks.
Posted

1 solution

Did you study http://www.mathworks.com/support/compilers/interface.html[^]?

As you are showing the linker error, it looks like you did not link the Matlab library.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900