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 ExchangeWorkspace 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