Effacer les filtres
Effacer les filtres

Performance-wise, should I create my App Interactively using app designer or code it from the startupFcn(app)?

2 vues (au cours des 30 derniers jours)
I am creating an application in MATLAB r2020b, which has a lot og UI elements (mainly uibuttons and uitextarea). I have a total of ~1000 elements organized in a gridlayout.
I am creating all the elements programatically in the startupFcn(app), but It takes a long time to open the app (~1 min).
Would it improve the perfomance of my app if I create all the elements interactively using app designer???

Réponses (1)

Jacob Mathew
Jacob Mathew le 10 Mai 2024
After reading through your question, I believe you want to compare the performance difference of programmatically adding elements to the app versus designing them using the App Designer interactive UI.
I have created an app shown below which comprises of several buttons and test area, which you have mentioned forms a large part of your app. Further, I have aligned them using a grid box as well, all interactively.
However, if you look at the code view:
Under the hood, App Designer converts your interactive UI element placement and properties into code as well. This ensures that the code it generates is optimised and only the necessary updates to the app are done. However, this auto generated code is not editable which could be a deal breaker if you have lots of custom coding to generate the UI elements.
Hence while there will be noticeable performance improvements as App Designer will load the UI elements in the initialisation function before rending them, they will not be drastic since fundamentally both are the same under the hood. However, there are perks like easier UI design and manipulation and limitations like lack of editing of UI elements when they are being initialised.

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by