フィルターのクリア

Passing data between two GUIs

1 回表示 (過去 30 日間)
Salad Box
Salad Box 2018 年 4 月 30 日
コメント済み: Salad Box 2018 年 5 月 1 日
Hi,
I made two GUIs, namely 'G1' and 'G2'.
For example, if I have a variable 'handles.index = 2' in G1, how can I read this variable in G2?
In more common cases, the variable I have in G1 has no fixed value, the value changes with certain operation in G1, how can I read the value of this variable in G2 afterwards?
Can you please help?
Many thanks!

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 4 月 30 日
You can use UserData property of the GUI's figure handle. UserData property is for the user to save their own data and MATLAB never process it. Unlike handles, UserData can be easily accessed using dot ( . ) notation. You can pass UserData property of one of the GUI figure to all the other GUIs. In this way, they will all be accessing one UserData property. Any modification made by one will be visible to every other GUI having the same handle.
  1 件のコメント
Salad Box
Salad Box 2018 年 5 月 1 日
Thank you for the suggestion!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by