如何在MATLAB编译的应用程序中运行外部.m代码? [英] How to run external .m code in a MATLAB compiled application?

查看:303
本文介绍了如何在MATLAB编译的应用程序中运行外部.m代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MATLAB项目,我使用MCC对其进行编译,以使其具有单个可执行文件.

I've got a MATLAB project, which I compile in order to have a single executable file, using MCC.

然后,我想知道外部程序员是否有可能在.exe中执行他的某些.m文件,而无需重新编译整个项目.

Then I would want to know if it's possible for an external programmer to execute some of his .m files within the .exe, without re-compiling the whole project.

重点是提供一个应用程序,其他开发人员可以在其中添加用MATLAB编写的插件".

The point is to provide an application in which other developpers could add their "plug-ins", written in MATLAB.

我已经搜索了一种在已编译的MATLAB应用程序中运行外部.m文件的方式(例如该线程:

I've searched a way of running external .m files inside compiled MATLAB application (like this thread : Running an .m file from a MATLAB-compiled function) but it doesn't fit my purposes here, altough it's working fine using eval().

但是这个eval()技巧"还不够,因为它不允许定义新的函数或类. 例如,我希望外部.m文件是新类(继承自可执行文件中的已编译接口").

But this eval() "trick" isn't sufficient, as it doesn't allow to define new functions or classes. For instance, I would like external .m files to be new classes (inherited from compiled "interfaces" in the executable).

有没有一种方法可以将.m文件动态加载到MATALB编译的可执行文件中? (即使需要MATLAB许可也是如此).

Is there a way to dynamically load .m files into a MATALB compiled executable ? (even if it needs a MATLAB licence to do such).

和/或是否有一些未记录的MATLAB"涉及这个特定的主题,我可以对其进行进一步研究?

And/or is there some "undocumented MATLAB" that refers to this particular topic that I could investigate further ?

此致

推荐答案

如果您能够创建并分发可以执行任意.m文件的已编译应用程序,则您的用户将能够执行MATLAB可以做的几乎所有事情,但免费(即使那不是您的意图).

If you were able to create and distribute a compiled application that could execute arbitrary .m files, your users would be able to do pretty much anything MATLAB can do, but for free (even if that wasn't your intent).

向他们提供该功能(即使您打算做一些更纯正和有用的东西)也违反了MATLAB Compiler的许可协议,MathWorks还设置了一些技术限制以使其难以实现.

Providing them with that capability (even if you intended something more innocent and useful) is against the license agreement for MATLAB Compiler, and MathWorks also put in place some technical restrictions to make it difficult to do so.

您可能会发现部分技术限制的解决方法,但是如果您让用户能够在插件中执行任意M代码,则将违反许可.

You might find a partial way around some of the technical restrictions, but if you give your users the ability to execute arbitrary m-code in a plugin, you'll be in breach of the license.

(当然是IANAL)

这篇关于如何在MATLAB编译的应用程序中运行外部.m代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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