Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8283943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:55:23+00:00 2026-06-08T10:55:23+00:00

So, I figured out how to call one gui from another and send back

  • 0

So, I figured out how to call one gui from another and send back and forth information via varargin and varargout. However, right now I’m in a situation where I have two separate guis (one is not called from the other), and I believe I need some other method if I want to communicate between them.

More exactly, I’m making two GUIs that interact with Simulink. One GUI opens when the model is opened and keeps track of information. The other GUI will open when a block is double-clicked. I want to send information from this GUI to the information-tracking GUI.

So, from what I’ve searched, I can accomplish this either by using a Listener in the information-tracking GUI; or I can modify the variables in the information-tracking GUI directly using setappdata/getappdata or findall(0, …).

So far my attemps haven’t worked and I was wondering if I’m taking the write approach. Can someone point me in a direction? Let me know if I can provide more info!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:55:24+00:00Added an answer on June 8, 2026 at 10:55 am

    I use the setappdata/getappdata method all the time for this sort of thing. Here is a general breakdown of what you do. When you create the figures give them a tag like this:

    figure( ..., 'Tag', 'info_gui', ... ); % tag name is up to you
    figure( ..., 'Tag', 'other_gui', ... ); % tag name is up to you
    

    Anytime you need the handle to one or the other figures just make a call to findobj like this

    info_gui_handle = findobj('tag','info_gui');
    other_gui_handle = findobj('tag','other_gui');
    

    Ok now lets store some example data in the info_gui that we will update later

    info_gui_data.x = 1;
    info_gui_data.y = 1;
    setappdata( info_gui_handle, 'info_gui_data', info_gui_data);
    

    Once you have your figures set up you can do things like this:

    % First you get a handle to the info gui figure
    
    info_gui_handle = findobj('tag','info_gui');
    
    % Next you get the appdata thats stored in this figure.  In this example
    % I have previously stored a struct variable called 
    % 'info_gui_data' inside the appdata of the info_gui
    
    info_gui_data = getappdata(info_gui_handle ,'info_gui_data');
    
    % Make your changes whatever they are.  Here I am modifying variables x 
    % and y that are stored in the struct info_gui_data
    
    info_gui_data.x = 2;
    info_gui_data.y = 2;
    
    % Now that I've made changes to the local variable info_gui_data I can 
    % now store it back into the info gui's appdata.
    
    setappdata(info_gui_handle ,'info_gui_data',info_gui_data);
    

    I like to store all of my figure appdata in one giant struct. Seems easier to keep track of but its up to you. Hope this helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't figure out how to call a base class method from a derived
I have written a dangerous program in C++ that jumps back and forth from
I've written a simple GUI using WTL: I've got everything figured out as far
I'm a newbie. I can't figure out how and where to call ResignFirstResponder to
I figured out how to clone my form rows and append an incriminting number
I figured out that a constant literal get's placed in the data segment of
I figured out that CUDA does not work in 64bit mode on my mac
I figured out how to get all the user's images in the camera roll
I figured out that of course . and SPACE aren't allowed. Are there other
I figured out how to pass a String value between activites thanks to this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.