Click here to Skip to main content
11,484,162 members (71,395 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C Matlab
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

#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 10-Apr-13 5:55am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 170
1 Frankie-C 155
2 Raje_ 155
3 OriginalGriff 147
4 CPallini 110
0 Sergey Alexandrovich Kryukov 8,484
1 OriginalGriff 7,948
2 Sascha Lefèvre 3,189
3 Maciej Los 2,601
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 10 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100