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 7527095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:01:26+00:00 2026-05-30T04:01:26+00:00

I have GUI in Matlab that I have made using the Programmatic approach. It

  • 0

I have GUI in Matlab that I have made using the Programmatic approach. It has 6 sliders and I want to be able to move one of them and have the others update as if i clicked them again but to stay in the same place. I am guessing I will need to use the set() function. Is there some function to do this in matlab already? I have been looking around. Any suggestions or something to point me in the right direction?

  • 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-05-30T04:01:28+00:00Added an answer on May 30, 2026 at 4:01 am

    If you are using guide, you can access the other sliders from the handles variable that is available in each callback.

    Set the Value property for them.

       function Slider1_CallBack(hObj,evt,handles)
           set(handles.Slider1,'Value',10);
           set(handles.Slider2,'Value',10);
          % etc..
       end
    

    In case you are using it programmaticaly, you can store the handles manually.

       function main
            handles.Figure1 = figure(..);
            handles.Slider1 = uicontrol(...);
            handles.Slider2 = uicontrol(...);
            guidata(handles.Figure1,handles);
       end
    

    And your slider callback should be:

       function Slider1_CallBack(hObj,evt)
           handles = guidata(hObj);
           set(handles.Slider1,'Value',10);
           set(handles.Slider2,'Value',10);
          % etc..
       end
    

    Edit A good practice in writing UI is separating the GUI logic from the actual data. You always change the data, and call updateGUI routine.

    Therefore, you can write your program like this:

       function main
            handles.gui.Figure1 = figure(..);
            handles.gui.Slider1 = uicontrol(...);
            handles.gui.Slider2 = uicontrol(...);
    
            handles.data.x = 1;
            guidata(handles.Figure1,handles);
       end
    
       function UpdateGui(handles)
            %Based on the data, update the GUI
            set(handles.Slider1,'Value',handles.data.x);
            set(handles.Slider2,'Value',handles.data.x+1);
       end 
    

    And the callback should look like:

       function Slider1_CallBack(hObj,evt)
           handles = guidata(hObj);
           handles.data.x = handles.data.x  + 1;
           UpdateGui(handles);
           guidata(hObj,handles);
          % etc..
       end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an assignment to create a GUI using MATLAB GUIDE and am having
I have a GUI tool that manages state sequences. One component is a class
I have an object-oriented MATLAB app that needs a GUI, and I'd like to
I have some Matlab code and a GUI for it and I want to
I have GUI created using netbeans GUI builder. I want to add there an
I have written a Matlab GUI for my C program. I thought about using
Using the GUI guide editor in Matlab 2008b, I have run into a problem
I have created a MATLAB GUI using GUIDE. I have a slider with a
I have some Matlab code and a GUI for it and I want to
I have a MATLAB GUI and a separate application that writes data to a

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.