Now next four days are for Module-2 in which we will cover, Graphical User Interface (GUI), Partial Differential Equation (PDE) toolbox and Signal processing toolbox. This module will be handled by my collogue Mr. Shailendra Singh, Assistant Professor, Department of Electronics & Instrumentation, Anand Engineering College, Agra.
10th and 11th days are dedicated to the GUI (Graphical User Interface), the GUI is very essential tool to make a program user friendly, with the help of GUI we can facilitate a user with push buttons, sliders, axes, images, panels etc. instead of writing MATLAB commands to run an application.
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent appearance.
The three principal elements of GUI
- Components: Each object on a MATLAB GUI is graphical component
- Containers: The components of a GUI must be arranged with in a container
- Callbacks: Finally, there must be some way to perform an action.
Basic steps to create a GUI
- Decide what elements are required for the GUI and what functions of each element will be. Make a rough layout of the components by hand on a piece of paper.
- Use the Matlab tool called guide (GUI Development Environment) to lay out the components on a figure. The size of the figure as well as the alignment and spacing of components on the figure can be adjusted using the tools built into guide
- Use a Matlab tool called Property Inspector to give each component a name and to set the characteristics of each component, such as its color or the text it displays.
- Save the figure to a file. When the figure is saved, two files will be created on disk with the same name but different extents. The fig file contains the GUI layout and the components of the GUI; the M-file contains the code to load the figure along with skeleton callback functions for each GUI element.
- Write code to implement the behavior associated with each callback function.
I will suggest my students to use the GUI to their projects to make it more understandable and worth full.