Contact Us:09993897203
Email: dstarenainfo@gmail.com
1st Branch: 121,Malviya Nagar,
New Market,Bhopal-462003
2nd Branch:146/7/2 Premium Center
Zone-1,MP Nagar
Bhopal-462011
Arrow Registration

How to Work on Graphical User Interface (GUI) in MATLAB?

A graphical user interface provides the user with a familiar environment in which to work. This environment contains pushbuttons, toggle buttons, lists, menus, text boxes, and so forth, all of which are already familiar to the user so that he or she can concentrate on using the application rather than on the mechanics involved in doing things. However, GUIs are harder for the programmer because a GUI-based program must be prepared for mouse clicks (or possibly keyboard input) for any GUI element at any time. Such inputs are known as events, and a program that responds to events is said to be event driven. The three principal elements required to create a MATLAB Graphical User Interface are

 

1.Components. Each item on a MATLAB GUI (pushbuttons, labels, edit boxes, etc.) is a graphical component. The types of components include graphical controls (pushbuttons, edit boxes, lists, sliders, etc.), static elements (frames and text strings), menus, and axes. Graphical controls and static elements are created by the function UI control, and menus are created by the functions UI menu and UI context menu. Axes, which are used to display graphical data, are created by the function axes.

2. Figures. The components of a GUI must be arranged within a figure, which is a window on the computer screen. In the past, figures have been created automatically whenever we have plotted data. However, empty figures can be created with the function figure and can be used to hold any combination of components.

3. Callbacks. Finally, there must be some way to perform an action if a user clicks a mouse on a button or types information on a keyboard. A mouse click or a keypress is an event, and the MATLAB program must respond to each event if the program is to perform its function. For example, if a user clicks on a button, that event must cause the MATLAB code that implements the function of the button to be executed. The code executed in response to an event is known as a callback. There must be a callback to implement the function of each graphical component on the GUI. The basic GUI elements are summarized in Table 1.1, and sample elements are shown in Figure 1.1. We will be studying examples of these elements and then build working GUIs from them.

Leave a Reply

Your email address will not be published. Required fields are marked *

.