How can we achieve interfacing of two GUI's?

조회 수: 1 (최근 30일)
Kishor KS
Kishor KS 2012년 12월 4일
Dear Sir/Madam Here i am trying to do interfacing of two gui's. I have made several gui's. My need is i.e if i click some push button it should open some other gui. Please tell me how to use setappdata and add any sample code. Please find the answer.

답변 (2개)

Mark Whirdy
Mark Whirdy 2012년 12월 4일
편집: Mark Whirdy 2012년 12월 4일
if you just put the name of gui2 inside the callback of the pushbutton of gui1, then gui2 does not open?
gui1_mybutton_callback(hobject,evnts,handles)
gui2;
use setappdata to pass data for more complex interation then
  댓글 수: 3
Mark Whirdy
Mark Whirdy 2012년 12월 4일
편집: Mark Whirdy 2012년 12월 4일
Its difficult to provide sample code without a more specific question where you provide code of your own which I could adapt my example code to. I think we're at the stage of doing some initial background reading. Broadly, you need to work with the handle to gui2 (as launched from the callback above), and then be using get() & set(), & getappdata() & setappdata() to manipulate the object properties of both gui's and store any data directly to the root for sharing as appropriate.
e.g.
setappdata(0,'my_variable',23) % set variable "my_variable" with value 23 to the root [i.e. 0 indicates the root]
Structures are handy in some cases:
mystruct.myval = 23;
setappdata(0,'mystruct',mystruct) ;
clear mystruct
mystruct = getappdata(0,'mystruct') ;
The links below will help further:
Kishor KS
Kishor KS 2012년 12월 4일
편집: Kishor KS 2012년 12월 4일
Thank you sir, i got the answer , i am very happy about the very very quick response from your side , thanks a lot

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


Image Analyst
Image Analyst 2012년 12월 4일
See the end of this section of the FAQ where it refers you to Doug's tutorials.
It's also not clear if you want one GUI to actually control another GUI, like change images, text, and plots on it, or if you just want to launch the second GUI, have the user interact with it, and then return values back to the first GUI. Which is it?
  댓글 수: 1
Kishor KS
Kishor KS 2012년 12월 4일
편집: Kishor KS 2012년 12월 4일
@image analyst Thank you, Basically i need to know how one gui is controlled by another gui with interaction between them along with returned values
I just want to launch the second gui from first gui.

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by