C++ matlab 引擎 c++回调函数
我正在编写一个应用程序,需要由 matlab 引擎完成一些操作。然而,在 matlab 脚本中我需要一些回调函数。是否可以在 matlab 脚本中创建返回到 C++ 函数的回调函数?
I'm writing an application which need to have some things done by the matlab engine. However, inside the matlab scripts I need some callback functions. Is it possible to create a callback function in a matlab script back to a c++ function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
免责声明:我从未亲自测试过这种方法
您可以通过使用 Matlab 构建器 NE 将 Matlab 代码编译为 COM 组件来完成此操作。
该组件将发送 COM 事件,您的应用程序将订阅它们。
请参阅 Matlab Builder NE 文档中的“向 COM 对象添加事件”部分。
您可以在这里阅读有关 COM 的信息:
http://en.wikipedia.org/wiki/Component_Object_Model
Disclaimer : I never tested this approach by myself
You can do it by compiling your Matlab code as COM component using Matlab builder NE.
This component will be sending COM events, and your application will subscribe to them.
See the "Adding Events to COM Objects" section in Matlab Builder NE documentation.
You can read about COM here:
http://en.wikipedia.org/wiki/Component_Object_Model