How can P-coded files be used in a MATLAB Compiler deployed standalone application?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 14 Apr. 2017
Bearbeitet: MathWorks Support Team
vor etwa 5 Stunden
I have P-coded files that I would like to share with another user. This person wants to use them in a deployed application created by the MATLAB Compiler. How can they use my P-files in their application without having access to the source M-files?
They have tried compiling the P-code. But the deployed application executes with errors. The result is different from running the P-code inside MATLAB Desktop.
Akzeptierte Antwort
MathWorks Support Team
am 31 Aug. 2024 um 0:00
Bearbeitet: MathWorks Support Team
vor etwa 5 Stunden
P-code is entirely opaque during dependency analysis. The run time errors may be due to missing dependencies during the compilation.
In order for another person to use your P-files in a standalone application, you will need to use the following tool which generates the associated dependency analysis and store this as function pragmas in another M-file:
After downloading this tool, please follow the steps below for analyzing a single MATLAB file (named "my_function.m" in this example):
1. Run the function call to create a file having function pragmas of dependent files like this:
>> createRequiredFunctionPragmasFile('function_list.m', 'my_function.m');
2. The function pragmas of dependent files will be in the "function_list.m" file. Distribute this "function_list.m" file along with p-coded file for "my_function" to the end user.
3. The end user will need to include the function pragmas file in the deployable archive when creating the compiled application.
To do this using the MCC command, they will need to use the "-a" flag similar to the following:
>> mcc -m my_app.m -a function_list.m
To do this using the Application Compiler, they will need to add the "function_list.m" file to the "Files required for your application run" section.
For more information and use cases, download the tool and consult the associated documentation in the "createRequiredFunctionPragmasFile.pdf" file.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Standalone Applications finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!