




























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
MATLAB GUI (Graphical User Interface) Tutorial for Beginners ... In this Matlab GUI tutorial, you will learn how to create and use the slider component.
Typology: Study notes
1 / 68
This page cannot be seen from the preview
Don't miss anything!





























































Why use a GUI in MATLAB?It makes things simple for the end-users of the program.The command line interface Vs. GUIThe command line interface Vs. GUI
Initializing GUIDE (GUI Creator)
Initializing GUIDE (GUI Creator)
want the graphical part of the GUI to look like.
Creating the Visual Aspect of the GUI: Part 1
Double click one of the
Static Text components. You should see the
property Inspector.
p
p^
p^
y^
p
Creating the Visual Aspect of the GUI: Part 1
Static Text component, but instead of changing the
String pa
rameter to +, change it to =, and another it to MyAdderGUI.4. For
Static Text component 0, modify the
Tag parameter to answer_staticText.
the following:
Creating the Visual Aspect of the GUI: Part 2
Modify the
pushbutton component.
Change the
String parameter to Add!
Change the
Tag parameter to add pushbutton.
Change the
Tag parameter to add_pushbutton.
Creating the Visual Aspect of the GUI: Part 2
You should have something like this:
When you save this file, MATLAB automatically generates two files:
myAdder.fig and
myAdder.m.
The .fig file contains the graphics of your interface.The .m file contains all the code for the GUI.The .m file contains all the code for the GUI.
Writing the Code for the GUI Callbacks
input2_editText_Callback.
Writing the Code for the GUI Callbacks
add_pushbutton_Callback.
Here is the code that we will add to this callback:
Launching the GUI
MATLAB GUI Tutorial - Slider
In this Matlab GUI tutorial, you will learn how to create and use the slider component.Sliders are useful controls for choosing a value in a range of values.Common uses are volume controls, seekers for movie and sound files as well as color picCommon uses are volume controls, seekers for movie and sound files as well as color pickers.An example of a slider is shown below.
Create the Visual Aspect of the GUI
Creating the Visual Aspect of the GUI: Part 1 1.^ For the adder GUI, we will need the following components
Edit T
t^
Edit Text component to the GUI figure.
Slider component onto the GUI figure.