从 Matlab 代码构建独立应用程序

发布于 2024-11-28 03:12:57 字数 1040 浏览 2 评论 0原文

我有一些 Matlab 代码和一个 GUI,我想制作一个独立的应用程序来保护我的源代码。我如何构建这个独立的? 感谢您的任何指导。

=================================================== ================================

我在帮助中找到:

如果您不想以此格式分发专有应用程序代码,则可以使用以下更安全的选项之一:

• 部署为 P 代码 — 将部分或全部源代码文件转换为内容模糊的形式,称为 P 代码文件(来自其 .p 文件扩展名),并以此格式分发应用程序代码。< /p>

• 编译为二进制格式 — 使用 MATLAB 编译器编译源代码文件以生成独立的应用程序。将后者分发给应用程序的最终用户。

使用 P 代码非常简单,没有任何问题。

构建独立的可执行文件

保护源代码的另一种方法是将其构建为独立的可执行文件,并将该可执行文件与任何其他必要的文件一起分发给外部客户。您必须安装 MATLAB 编译器和受支持的 C 或 C++ 编译器才能准备部署文件。然而,最终用户不需要 MATLAB。

要为您的 MATLAB 应用程序构建独立应用程序,请按照 MATLAB 程序文件的常规过程开发和调试您的应用程序。然后,按照 MATLAB 编译器文档中程序员部署到最终用户的步骤中的说明生成一个或多个可执行文件。

  1. 创建一个包含运行时所需软件的包。查看程序员需要什么软件?了解更多详情。

要将使用 MATLAB Compiler 创建的独立应用程序分发到开发计算机,请创建一个包含以下文件的包。

MCRInstaller.exe(Windows)

MCRInstaller 是一个自解压可执行文件,可安装开发应用程序所需的组件。该文件包含在 MATLAB 编译器中。

application_name.exe (Windows)

由 MATLAB 编译器创建的应用程序。 Maci64 必须包含包目录层次结构。

I have some Matlab code and a GUI for it and I want to make a standalone app to Protect my Source Code. How can I build this standalone?
Thank you for any guide.

================================================================================

I found in help:

If you do not want to distribute your proprietary application code in this format, you can use one of these more secure options instead:

• Deploy as P-code — Convert some or all of your source code files to a content-obscured form called a P-code file (from its .p file extension), and distribute your application code in this format.

• Compile into binary format — Compile your source code files using the MATLAB Compiler to produce a standalone application. Distribute the latter to end users of your application.

working with P-codes is straightforward and no problem.

Building a Standalone Executable

Another way to protect your source code is to build it into a standalone executable and distribute the executable, along with any other necessary files, to external customers. You must have the MATLAB Compiler and a supported C or C++ compiler installed to prepare files for deployment. The end user, however, does not need MATLAB.

To build a standalone application for your MATLAB application, develop and debug your application following the usual procedure for MATLAB program files. Then, generate the executable file or files following the instructions in Steps by the Programmer to Deploy to End Users in the MATLAB Compiler documentation.

  1. Create a package that contains the software needed at run time. See What Software Does a Programmer Need? for more details.

To distribute a standalone application created with MATLAB Compiler to a development machine, create a package that includes the following files.

MCRInstaller.exe (Windows)

MCRInstaller is a self-extracting executable that installs the necessary components to develop your application. This file is included with MATLAB Compiler.

application_name.exe (Windows)

Application created by MATLAB Compiler. Maci64 must include the bundle directory hierarchy.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

遗忘曾经 2024-12-05 03:12:57

我想您已经被 .exe 文件的吸引力所吸引了。如果您的目标是 IP 保护,那么 .p 代码就足够了。如果您的目标是拥有 .exe 文件,那么它不仅仅是 IP 保护。

其他人已经说过该文档简单明了。 这是一个非常简单的分步示例,用于创建已编译的例如,使用 Matlab 编译器。请记住,如果您想了解它是如何完成的,您需要购买编译器或者至少使用试用版。

I think you're getting caught up on the attraction of the .exe file. If your goal is IP protection, then the .p code suffices. If your goal is to have a .exe file, then it's not simply IP protection.

Others have already stated that the documentation is simple and straightforward. Here is a very simple step-by-step example for creating a compiled example, using the Matlab compiler. Keep in mind you need to buy the compiler or at least use the trial version if you want to see how it is done.

你穿错了嫁妆 2024-12-05 03:12:57

您不必部署独立的应用程序来保护您的代码:您可以生成 P-code 文件来自 M 文件,这是一种混淆源代码的方法。

You don't have to deploy a standalone application to protect your code: you can generate a P-code file from your M-files, which is a way to obfuscate source code.

‘画卷フ 2024-12-05 03:12:57

Mathworks 提供了一个工具包 ($$),用于将 MATLAB 程序编译为可执行 (.exe) 文件,该文件无需 MATLAB 许可证即可在任何具有 Matlab 编译器运行时 (MCR) 的计算机上运行。

因此流程如下所示:

  1. 开发 MATLAB 应用程序(m 文件集)
  2. 创建简单的 matlab 脚本以利用 Matlab 编译器(例如 make.m)
  3. 运行 make 脚本以创建 MyApplication.exe
  4. 部署 MyApplication.exe 和 Matlab 编译器运行时 (MCR)向您的用户

详细信息可以在 Mathworks 网站上找到。

Mathworks offers a toolkit ($$) in order to compile your MATLAB programs into an executable (.exe) file that can run without a MATLAB license on any computer with the Matlab Compiler Runtime (MCR).

So the flow would look like:

  1. Develop MATLAB application (set of m files)
  2. Create simple matlab script to utilize Matlab compiler (e.g. make.m)
  3. Run the make script to create MyApplication.exe
  4. Deploy MyApplication.exe and Matlab Compiler Runtime (MCR) to your users

Details can be found on the Mathworks website.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文