Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
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???

Risposte (1)

Jacob Mathew
Jacob Mathew il 10 Mag 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.

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by