フィルターのクリア

P-code compiled application doesn't run correctly

2 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2017 年 4 月 14 日
編集済み: MathWorks Support Team 2024 年 5 月 21 日
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.

採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 5 月 21 日
編集済み: MathWorks Support Team 2024 年 5 月 21 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStandalone Applications についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by