Performance-wise, should I create my App Interactively using app designer or code it from the startupFcn(app)?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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???
0 Kommentare
Antworten (1)
Jacob Mathew
am 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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!