MATLAB: How to declare a global variable in Startup function of matlab app.designer

2019appapp designerdesignerglobalglobal variableMATLABstartupstartup functionvariable

I want to declare a global variable in matlab app designer's startup function in order to use it continuously through the app's code.
Specifically, I want to declare value1 as a global variable
I have tried that but it doesn't seems that works.
Thank you very much

Best Answer

Do not use global variables, especially in AppDesigner.
Instead, declare a public or private property accessible anywhere within the app or outside of the app (for public properties).