Azzera filtri
Azzera filtri

P-code compiled application doesn't run correctly

2 visualizzazioni (ultimi 30 giorni)
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 than running the P-code inside MATLAB Desktop.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 21 Mag 2024
Modificato: MathWorks Support Team il 21 Mag 2024
P-code is entirely opaque during dependency analysis. The run time errors may be due to missing dependencies during the compiling. 
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 DEPLOYTOOL, 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.

Più risposte (0)

Categorie

Scopri di più su Standalone Applications in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Prodotti


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by