How to define a global variable
Ältere Kommentare anzeigen
My app has many button with their own callbacks. I wanna define a variable inside one of such callbacks and i want to use it in other places including startupfcn, properties etc.
Antworten (2)
KALYAN ACHARJYA
am 22 Okt. 2019
Bearbeitet: KALYAN ACHARJYA
am 22 Okt. 2019
0 Stimmen
Here Matlab Documentation:
Steven Lord
am 22 Okt. 2019
0 Stimmen
While you can use global variables for this type of sharing, we recommend you use other techniques instead. See the "Share Data Within App Designer Apps" topic on this documentation page if you're using App Designer. If you're using GUIDE or creating the app programmatically, see the "Share Data Among Callbacks" topic on this documentation page.
3 Kommentare
Ni2
am 22 Okt. 2019
Ni2
am 22 Okt. 2019
Steven Lord
am 23 Okt. 2019
See the descriptions of the Access, GetAccess, and SetAccess property attributes in the documentation. These attributes control who can query and change the property's value and from where they can be queried or changed.
If you stored your name in a property of the you object, it would likely have public GetAccess (anyone can ask you for your name) but would not have public SetAccess (few people have the right to change your name.)
Your bank account number would not have public GetAccess (not everyone should be able to know that information.)
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!