Matlab Deployed Applications and Libraries
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a very large Matlab application, and am able to use the mcc command to successfully make it a stand-alone application.
However, our application also supports the ability for the user to create custom *.m files to perform certain behaviors, sort of like a plugin. We do not compile these files, as they are in a separate location and can be changed at any time. To allow our users to utilize these files in a deployed application, when the user selects one of these files to be used, we actually open an instance of regular Matlab, process their file, and return the data produced back to our deployed application (in a struct), to allow the user to inspect it.
We would like to have a way to compile/create a library of those custom *.m files, that our deployed application could access, instead of having a very unstable interface. I have looked at the libraryCompiler tool, but that seems to be for Java/C++/etc, I can't find anything for making a library of *.m files.
Quick summary:
- Currently have a large "main" GUI application.
- The application can access custom user-written functions (.m files) in a completely different directory, even across a network.
- Would like a way to compile/deploy those functions in a way that could be treated as an "external" library and be used by a deployed version of the main application.
Thanks a bunch! If there's anything I can clear up, please let me know.
0 个评论
回答(1 个)
Dirk Engel
2025-1-27
Any kind of plug-in pattern using m-files is not possible. This is because during compilation your application gets encrypted by a random key, and other m-files not matching the same encryption cannot be accessed by the deployed application anymore.
Your deployed app can still talk to other deployed packages, though. For example, you could compile those "external" m-files to a separate class library which you could reference from your GUI app.
Alternatively, if those user functions are simple enough so that they can be re-written as a script instead of as a function, your MATLAB code can textread() the external file to a string variable and eval() it.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!