MATLAB编译器与MATLAB Coder [英] MATLAB Compiler vs MATLAB Coder

查看:495
本文介绍了MATLAB编译器与MATLAB Coder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两者之间有什么区别?

据我了解,MATLAB Compiler将MATLAB代码包装到一个.exe文件中,因此无需安装MATLAB就可以使用它,而只需要MCR.最重要的是,MATLAB Builder NE还可以用于生成与.Net框架一起使用的.Net程序集,而不是.exe文件,但它们仍需要MCR.

As far as I understand it, MATLAB Compiler wraps the MATLAB code into a .exe file so that it can be used without installing MATLAB, and only requires the MCR. On top of it MATLAB Builder NE can also be used to produce .Net assemblies to be used with .Net framework instead of the .exe file, but they still require MCR.

现在我不明白MATLAB Coder的用途是什么?它生成C/C ++代码.但是,是将MATLAB代码真正转换为C/C ++,还是像在MATLAB Compiler的情况下那样打包?它还需要MCR来运行吗?

Now I don't understand what MATLAB Coder used for? It generates C/C++ code. But is the MATLAB code really converted into C/C++, or is it merely packaged like in the case of MATLAB Compiler? Does it also need the MCR to run?

我知道这不是一个编程问题.但是我已经搜索了互联网,但仍然没有找到明确的答案.这些都是非常昂贵的产品,所以我想知道我要怎么做.

I understand that this is not exactly a programming question. But I have searched the internet and still haven't found a clear answer. These are very expensive products so I would like to know what I am getting into.

推荐答案

MATLAB编译器加密并存档您的MATLAB代码(仍作为MATLAB .m代码保留),并将其打包为精简可执行文件(.exe或.dll)包装器.它与MATLAB编译器运行时(MCR)一起交付给最终用户.如果您愿意,也可以将MCR打包在可执行文件中.

MATLAB Compiler encrypts and archives your MATLAB code (which remains as MATLAB .m code), and packages it in a thin executable (either .exe or .dll) wrapper. This is delivered to the end user along with the MATLAB Compiler Runtime (MCR). If you wish, the MCR can be packaged within the executable as well.

MCR是可自由重新分发的,您可以将其视为本质上是没有前端桌面的MATLAB的副本.

The MCR is freely redistributable, and you can think of it as essentially a copy of MATLAB without a front-end desktop.

当用户运行可执行文件时,它将对归档代码进行归档和解密,然后针对MCR(而不是MATLAB)运行它.因此,通过此方法交付的应用程序应与在MATLAB中运行的应用程序完全相同(包括相同的速度).

When the user runs the executable, it dearchives and decrypts the MATLAB code, and runs it against the MCR instead of MATLAB. Applications delivered via this method should therefore run exactly the same as they do within MATLAB (including the same speed).

MATLAB Coder 将MATLAB语言的子集转换为C代码.然后,可以用许多不同的方式来使用它,包括以mex文件的形式带回MATLAB,使用C编译器进行编译以从另一个应用程序调用或传递给嵌入式设备.由于它是C代码而不是MATLAB代码,因此它通常(尽管不总是)比原始MATLAB代码运行得快得多. C代码不需要MCR.支持的MATLAB语言子集非常广泛,但是在提交此工作流之前,您需要考虑一些明显的限制.生成的代码是C代码,但是如果需要使用C ++编译器而不是C编译器,则可以生成C ++包装器.

MATLAB Coder converts a subset of the MATLAB language into C code. This can then be used in many different ways, including being brought back into MATLAB as a mex file, compiled with a C compiler to be called from another application, or delivered to an embedded device. Since it is C code rather than MATLAB code, it will often (though not always) run much faster than the original MATLAB code. The C code does not require the MCR. The supported subset of the MATLAB language is very extensive, but there are a few notable restrictions that you would want to look into before committing to this workflow. The code produced is C code, although it can produce a C++ wrapper if you have a need to use a C++ compiler rather than a C compiler.

MATLAB编译器适用于您想要与(没有)MATLAB副本的人简单和(公正地)直接共享您编写的MATLAB应用程序的用例.由于部署的.m代码是经过加密的,因此也可以用于共享MATLAB代码,同时保护知识产权.

MATLAB Compiler is intended for the use case that you want to simply and (fairly) straightforwardly share a MATLAB application that you've written with someone who does not have a copy of MATLAB. Since the deployed .m code is encrypted, it can also be used to share MATLAB code while protecting intellectual property.

MATLAB Coder 还有其他用例,例如想要通过转换为mex文件来加速MATLAB代码,或者需要为其他应用程序或嵌入式设备生成C代码.

MATLAB Coder has other use cases, such as wanting to speed up MATLAB code by converting to a mex file, or needing to produce C code for another application or an embedded device.

如果您有更详细的问题,我真的建议您致电MathWorks并询问他们.

If you have more detailed questions, I would really recommend that you just call up MathWorks and ask them.

编辑:上面的信息对于MATLAB R2014b及更低版本是正确的.从MATLAB R2015a开始, MATLAB Compiler 的功能已与 MATLAB Builder 产品的功能重新混合,并且还有一个新产品 MATLAB Compiler SDK >.

Edit: The information above is correct for versions of MATLAB R2014b and below. As of MATLAB R2015a, functionality from MATLAB Compiler has been remixed with functionality from the MATLAB Builder products, and there is also a new product MATLAB Compiler SDK.

从R2015a开始, MATLAB编译器以与上述相同的方式工作(即加密,存档和打包,但不生成C),但现在将打包为.exe和Excel加载项(.xla).在R2015a之前,此功能曾经在产品 MATLAB Builder EX for Excel 中提供.

As of R2015a, MATLAB Compiler works in the same way as described above (i.e. encrypt, archive and package, but not producing C), but will now package as .exe, and as an Excel add-in (.xla). Prior to R2015a, this functionality used to be present in the product MATLAB Builder EX for Excel.

从R2015a开始, MATLAB编译器不再生成.dll组件.此功能已移至新产品 MATLAB Compiler SDK ,该产品还包括用于生成.NET程序集和Java类的功能.在R2015a之前,此功能曾经存在于产品用于.NET的MATLAB Builder NE 用于Java的MATLAB Builder JA 中.

As of R2015a, MATLAB Compiler no longer produces .dll components. This functionality has been moved to the new product MATLAB Compiler SDK, which also includes functionality to produce .NET assemblies and Java classes. Prior to R2015a, this functionality used to be present in the products MATLAB Builder NE for .NET and MATLAB Builder JA for Java.

换句话说:

在R2014b及更低版本中,我们拥有:

In R2014b and below, we had:

MATLAB编译器:生成.exe和.dll组件

MATLAB Compiler: produce .exe and .dll components

用于.NET的MATLABLAB Builder NE :生成.NET程序集

MATLAB Builder NE for .NET: produce .NET assemblies

MATLAB Builder JA for Java :生成Java类

用于Microsoft Excel的MATLAB Builder EX :生成Excel加载项.

MATLAB Builder EX for Microsoft Excel: produce Excel add-ins.

在R2015a中,我们有:

In R2015a, we have:

MATLAB编译器:生成.exe和Excel加载项

MATLAB Compiler: produce .exe and Excel add-ins

MATLAB编译器SDK :生成.dll,.NET程序集和Java类.

MATLAB Compiler SDK: produce .dll, .NET assemblies and Java classes.

MATLAB Coder 的范围和用例在这些发行版中没有发生变化(尽管有新功能).

The scope and use-cases of MATLAB Coder have not changed across these releases (although there are new features).

编辑:从R2015b开始, MATLAB编译器SDK 还会生成Python软件包.

Edit: As of R2015b, MATLAB Compiler SDK also produces Python packages.

有关区分

Additional information on distinguishing MATLAB Coder and MATLAB Compiler for C/C++ can be found here.

不同的比较表用于代码生成的MATLAB产品.

这篇关于MATLAB编译器与MATLAB Coder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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