Error during creation of standalon application

1 次查看(过去 30 天)
I have a small script which has a GUI. I would like it to pass around my colleagues, but most of them don't have matlab and I also wouldn't like them to screw around in the code. Therefore I wanted to make an .exe from it, but somehow I receive this error message:
Warning: In "C:\01_Basic_Script\functions\Loader.m", "transp" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.
Warning: In "C:\01_Basic_Script\functions\cat_results.m", "transp" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.
Parsing file "C:\01_Basic_Script\functions\blob_read.mlapp"
(referenced from command line).
It seems like there is a problem with the parse function, but I have no clue what. Do I need a higher license to make it to an app? Sounds strange.
Thanks for the helps!
Bence

回答(1 个)

Ayush Aniket
Ayush Aniket 2023-12-26
Hi Bence,
As per my understanding, the warnings indicate that your script is using a function 'transp' which is not permitted to be included in compiled MATLAB applications. This restriction is due to the MATLAB Compiler license. The MATLAB Compiler does not allow all functions to be compiled for deployment, especially those that are part of certain toolboxes. Please refer to the following documentation pages to read more about the limitations and unsupported functions:
Here are few workarounds you can try to resolve this issue:
1. If the 'transp' function is not essential to the operation of your GUI, you can remove it from your code or you can look for alternate functions that can be compiled.
2. If you need to keep the function for MATLAB users but still want to create an executable for users without MATLAB, you can use the 'isdeployed' function to ensure that the restricted function is only called when the code is running in MATLAB and not in the compiled application as shown below:
if ~isdeployed
% Code that uses the restricted function
else
% Alternative code for the compiled application
end
You can read more about the 'isdeployed' function and the steps to follow for writing deployable code by referring to the following links:
Lastly, creating an executable from your MATLAB script using MATLAB Compiler does not require a higher license, but you must ensure that your code does not use any functions excluded from packaging by the license agreement.
Hope it helps.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by