Is there any way to determine if an app is being ran as a compiled executable via MATLAB Runtime or as a mlapp file via MATLAB?

6 vues (au cours des 30 derniers jours)
I have an app that unfortunately requires some functionality to be reduced when running as a compiled executable due to MATLAB Compiler not liking str2sym. I would like to know prior to that portion of the code running whether the user is running it from the compiled version or as a .mlapp file so that I can get ahead of the errors it would cause. Is there any way to determine what form the program is in when ran? Thanks!

Réponse acceptée

Githin George
Githin George le 27 Août 2024
Déplacé(e) : Voss le 27 Août 2024
Hi Austin,
You can try using the "isDeployed" function in MATLAB to determine whether the MATLAB code is running from a compiled executable or from a MATLAB session.
Please refer to the documentation for more information:
  2 commentaires
Steven Lord
Steven Lord le 27 Août 2024
Technical correction: there is no isDeployed function in MATLAB or any MathWorks products as far as I'm aware. The function has two lower-case d's: isdeployed.
which -all isDeployed
'isDeployed' not found.
which -all isdeployed
built-in (/MATLAB/toolbox/matlab/general/isdeployed)
Austin B
Austin B le 27 Août 2024
Thanks to you both! This solution worked perfectly.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by