Can we use l,k,z as global variables in GUI rather than using x,y,z ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Gayatri B
am 18 Sep. 2019
Kommentiert: Gayatri B
am 19 Sep. 2019
I'm working on image steganography code. Here I have used global l, global k, global z in the code. Is that fine or should I use global x, global y, global z ?
2 Kommentare
Geoff Hayes
am 18 Sep. 2019
Gayatri - why are you using global variables at all? Please describe why you feel you need to use them...
Akzeptierte Antwort
Guillaume
am 18 Sep. 2019
You shouldn't be using global variables at all. There's always better ways of doing whatever it is you're doing.
As for the name of global variables, you can use whatever you want. If you do use global variables (which are a major source of bugs) I would recommend using very descriptive names rather than one letter variables.
Obviously, the name must be the same in each unit of code that uses these variables.
3 Kommentare
Guillaume
am 18 Sep. 2019
You can use the handles structure to pass data between callbacks.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox 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!