How Do I Set Slider Handles in Matlab?

104 54
    • 1). Open Matlab, type "guide" in the command window and press "Enter."

    • 2). Click the second tab to open an existing GUI project. Select the project you would like to open from the list, and click "OK."

    • 3). Click the slider icon on the objects palette to add a slider to your GUI.

    • 4). Double-click the slider object to open the property inspector.

    • 5). Change "Tag" to the name you wish to call your slider. For example, "slider1."

    • 6). Click the "Save" icon in the GUI editor, and your GUI's code should appear. If not, click the pencil and paper icon to open the code.

    • 7). Scroll down the code until you see the "slider1_Callback" function.

    • 8). Type "n = get(handles.Handlename,'Value');" below the last line of the "slider1_Callback" function. "Handlename" should be the name of another object (e.g. text box) at whose value you want to set the slider.

    • 9). Type "set(handles.slider1,'Value',n));" below the last line of the line you typed in Step 8 to pass the value from the other handle to your slider. Set your slider at that value.

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.