GUI with figure object
This is the old way to create GUI with matlab. You can use uicontrol() function to design all kinds of buttons, text input or pushbuttons. The main window of old matlab GUI is actually a figure window. So all the button and control tools are actually operated on this figure object[1].
Basic Frames
See this minimal example[1]
1 | function SampleGUI() |
From this mini example, we can clearly see that all the control buttons are build on this figure, which is an object and it is used as one of the most import inputs for all the other buttons. Then the rest work just involves how to use these control buttons.
Control buttons[2]
Label box
The main purpose of label box is to display some information for other buttons.
1 | uicontrol('Style','text','Parent',... |
Text box
Receives a string and output a string.
1 | % Label of shot |
Push button
1 | % Button to run inside window |
Push button triggers function new_plot() after any press on it.
Radio button
1 | RMP_ui = uicontrol('Style','radio','Parent',... |
x = get(RMP_ui, ‘value’)
x = 1, if Radio button is check. x = 0 if Radio button is not checked. The default state is not checked.
Popup menu
1 | % popup menu to choose among IRMP/phi_RMP |
The selection value is get by:
x = get(POP_RMP_ui, ‘value’)
The value you get as x is increasing with number of selection from 1 to length(string).
Figure plot
This is rather simple. Because there is already a figure window, what you need to do rest is only to fill this figure window with subplot. But you need to set the parameter for the axes of this subplot, defining their position, grids, ticks, paras.
Reference
[1] https://www.mathworks.com/help/matlab/creating_guis/about-the-simple-programmatic-gui-example.html
[2] https://www.mathworks.com/help/matlab/ref/uicontrol.html