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 Comment

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

Sign in to comment.

Answers (1)

Jan
Jan on 1 Feb 2012
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?

Tags

Asked:

on 1 Feb 2012

Community Treasure Hunt

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

Start Hunting!