Use global variable in another GUI.
이전 댓글 표시
Hello! I´ve created a global variable in a main GUI. A buttom on this opens a second GUI where I need to use the global variable. Must I declare:
global MyVariable;
in every function where I will use MyVariable inside the second GUI? Or there is a way to declare it once?
댓글 수: 1
Stephen23
2017년 10월 30일
@Brian Damian Luna: you would be best off avoiding global variables entirely. Passing arguments is much more reliable, and much easier to debug.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!