Run a .mlapp script from a .m script with input variables and output variables
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Adam Handley
le 9 Fév 2024
Commenté : Kojiro Saito
le 13 Fév 2024
I have created an app using the app designer and the .mlapp script works as I want it when I run it from within the app designer specifying the input variable from the run icon. I am yet to work out how to get the app work similar to a function with it accepting input variables and outputting variables.
I have tried calling the mlapp script from within the .m script by script_name(input) but it doesn't accept the input variables in this way. I have tried specifying the input variable as a global variable and using the run function but neither of these seem to pass the input variable into the app's code. I have also tried some of the options for outputing variable from the app. I tried the assignin function but I can't tell if this is working without getting it to run properly in the .m script. I know I could get it to work with save and load functions but this seems clunky. Ideally I would like the app to run as a function with all the same functionality as the app designer.
I have read online that you could change the classdef to a function. If anyone has any documentation on how to do this or an example that would be helpful.
0 commentaires
Réponse acceptée
Kojiro Saito
le 13 Fév 2024
You can call your .mlapp with input argtuments.
Here is a document: Startup Tasks and Input Arguments in App Designer
Please see "Define Input App Arguments" section. You need to change Code Options so that it allows input arguments.
5 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!