是否可以在MATLAB环境内外执行已编译的代码? [英] Is it possible to execute compiled code both within and out of MATLAB environment?

查看:56
本文介绍了是否可以在MATLAB环境内外执行已编译的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我解释一下我要做什么.我有一个用Matlab编码的应用程序,我想将其提供给Matlab用户和非Matlab用户. 所以您会说:只需编译它并部署一个可执行文件即可.好吧.

Let me explain what I am trying to do. I have an application coded in Matlab and I would like to provide it to both Matlab users and non-Matlab users. So you would say : Just compiled it and deploy an executable. Fine.

但是已部署的应用程序在某种程度上受到您的限制(非常重要的是,您无法执行其他M文件),因此我也希望Matlab用户可以从Matlab内部启动已部署的应用程序并提供这些家伙的这些高级功能. 那有可能吗?

But deployed application are somehow limited in what you can do (very importantly, you can't execute other M-file) so I would like to ALSO make it possible to Matlab users to start the deployed application from Within Matlab and provide these advanced capabilities for these guys. So Is it possible?

当然,我可以提供两个版本:.exe和.m,但这并不是很优雅,也许有一个不错的技巧可以做到这一点. 任何的想法?

Of course, I could provide two versions : A .exe and .m but this is not really elegant and maybe there is a nice trick to do this. Any idea?

推荐答案

您可以在已部署的应用程序中使用eval.您也可以阅读.m文件,因为它们不过是文本. 因此,读取文件,逐行评估,然后就可以在已编译的Matlab程序中使用3d派对脚本.m文件.

You can use eval in deployed applications. You can also read .m files, since they are nothing but text. So, read the file, evaluate line by line, and there you go, you have an ability to use 3d party script .m files in your compiled Matlab program.

您将无法以这种方式使用功能,只能使用脚本.

You will not be able to use functions in this way, only scripts.

我唯一不确定的是它是否合法.我不能保证,您将不得不自己联系Mathworks.

The only thing I am not sure is whether it's legal. I can't guarantee that, you will have to contact Mathworks by yourself.

这篇关于是否可以在MATLAB环境内外执行已编译的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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