Error during creation of standalon application

1 visualización (últimos 30 días)
Bence
Bence el 19 de Dic. de 2023
Respondida: Ayush Aniket el 26 de Dic. de 2023
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

Respuestas (1)

Ayush Aniket
Ayush Aniket el 26 de Dic. de 2023
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.

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by