在C中调用matlab程序 [英] Calling a matlab programme in C

查看:78
本文介绍了在C中调用matlab程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用C来调用.m matlab程序进行采样。

到目前为止,我在论坛中发现的代码是在matlab库中调用matlab的特定函数而不是调用整个.m 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.

推荐答案

你学过http://www.mathworks.com/support/compilers/interface.html [ ^ ]?



As你显示链接器错误,看起来你没有链接Matlab库。



-SA

这篇关于在C中调用matlab程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆