matlab compiler vs mcc functionality
12 次查看(过去 30 天)
显示 更早的评论
Hi, I am testing out the matlab compiler and the mcc function. I cannot get a full overlap of functionality between them. For example:
When using the mcc function, is there a way to include matlab runtime in the package, and specify the name of the installer executable? That is, the equivalent of the check box and edit field at the top of the compiler.
When using matlab compiler, is there a way to specify conversion of m files to p code (the '-p' option)?
Also, how do I validate that my compiled executable is using p code rather than m files?
I noticed some behaviour with matlab compiler regarding precedence that I think is contrary to the documentation. If the m files are in the same folder as the main file, then the m files take precedence over p code files, otherwise p code files take precedence. I suspect it is not matlab's intention that you create the p code files separately prior to compiling the executable, as I could not get this to work using mcc or compiler. I can only get it to work using mcc on m files with the '-p' option on. Some better examples or guidance would help here, as I am testing out lots of different ways to do things in the hope of finding what works.
Apologies if this is too many questions in one post.
0 个评论
回答(1 个)
Dirk Engel
2024-4-27
I assume that by "MATLAB Compiler" you are referring to the MATLAB Compiler user interface (deplytool) which you can use to build and package your app. mcc only covers the build step, not the packaging. That's why there is no full overlap between the two.
Use the -o option of mcc to specify the name of the final executable.
Note that the compiled application contains encrypted files with the .m extension, but these are no normal m-files. They are neither human-readable, nor can they be be decrypted (to the best of my knowledge), nor can they be taken from the compiled app and used in a different context such as in MATLAB or in another compiled app. The files are encrypted with a key that changes with each compilation, so they only work in the context of that one specific compiled app. There is no need to create p-code before compilation. Your intellectual property is well protected in a compiled app.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!