- if the function is used by other functions, obviously it should remain external in most cases.
- If the function is very long and you'd like to keep the app code short and sweet. In your case, it sounds like the function should be internal to the app so you can share properties more efficiently as you've mentioned.
App Designer. Should I use app functions or external fuctions?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I created a "program" based in scripts and functions and I have merged it into an app from App designer to make it more user friendly. However, I noticed that the "same" operations are now much slower and crashing more often than when I was not using the App designer, so I wonder if the app somehow makes it less efficient.
I am using "app" functions written in the app code. I wonder If I should externalize all the functions and create isolated function files so I can call them from the app code. One of the reasons I prefer the internal app functions is because I play with some properties shared between the functions. But I guess I can pass the properties/variables trough the functions arguments.
0 commentaires
Réponse acceptée
Adam Danz
le 31 Août 2021
Modifié(e) : Adam Danz
le 1 Sep 2021
> I noticed that the "same" operations are now much slower and crashing more often than when I was not using the App designer, so I wonder if the app somehow makes it less efficient.
App have a slower startup time than using m-files directly. Rendering in UIFigures is also slower than rendering in regular figures. Other than that, running code from an app isn't noticeably slower than outside of an app in my exerpience. If the code works outside of app designer, it shouldn't crash within app designer. So there may be some errors in your implementation or severe suboptimalities, or perhaps you've found a bug. Sharing error messages, describing user interactions that cause a crash, or providing the files needed to reproduce the crash would be helpful, along with knowing your Matlab release.
> I am using "app" functions written in the app code. I wonder If I should externalize all the functions and create isolated function files so I can call them from the app code.
I answered a similar question yesterday. There are limited circumstances that I would recommend using external m-file functions.
0 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!