global variable in different GUI

hi, i'm trying to create a small gui program, there will be a sequence a many gui fiures, iwould like to pass data from one data to another when clicking on next button that will open a new window and close the current one, first i tried to write data in an xls file, but it made my program very slow, then i tried to create a global matrix 'data' in the first window, but the problem is that while passing to the next window all data were lost even though i declared global variable in every function.

댓글 수: 1

Friedrich
Friedrich 2012년 2월 1일
maybe its better not to use global variables. similar question was asked here:
http://www.mathworks.com/matlabcentral/answers/5447-passing-data-between-two-different-gui-window-using-guide

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2012년 2월 1일

1 개 추천

Global data are not lost, if you implement them without a bug. So either find the bug and eliminate it or avoid using globals. The later is a good programming practice.
Are multiple GUIs open at the same time? If not, can you implement them as panels in the same figure? Then the values can be stored by guidata easily.
Have you read this already: FEX: Matt's 41 GUI examples?

카테고리

도움말 센터File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

태그

질문:

2012년 2월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by