필터 지우기
필터 지우기

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 CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by