0% found this document useful (0 votes)
47 views

Creating and Displaying Graphical User Interface

A graphical user interface (GUI) provides a visual way for users to interact with programs using elements like buttons, menus, text boxes that are familiar. GUIs make programs easier to use. MATLAB uses three main components to build GUIs: components like buttons and menus, containers that arrange components visually, and callbacks that define what happens when a user interacts with a component. The GUI Development Environment (Guide) tool in MATLAB allows building GUIs visually by laying out components, setting their properties, and generating code to display the GUI and handle user interactions through callbacks.

Uploaded by

Sariga Santhosh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Creating and Displaying Graphical User Interface

A graphical user interface (GUI) provides a visual way for users to interact with programs using elements like buttons, menus, text boxes that are familiar. GUIs make programs easier to use. MATLAB uses three main components to build GUIs: components like buttons and menus, containers that arrange components visually, and callbacks that define what happens when a user interacts with a component. The GUI Development Environment (Guide) tool in MATLAB allows building GUIs visually by laying out components, setting their properties, and generating code to display the GUI and handle user interactions through callbacks.

Uploaded by

Sariga Santhosh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

GUI

A graphical user interface is a pictorial interface to a program. A good GUI can make
programs easier to use by providing them with consistence appearance, and intuitive controls
the GUI should behave in an understandable and predictable manner, so that the user knows
what to expect when performs an action. A graphical user interface provides the user with a
familiar environment in which to work. It contains push button ,toggle buttons,list, menus,
text boxes, and so forth, all of which are already familiar to the user,so that user can the
instead of the mechanics involved in doing things.the three principal elements required to
create aMATLAB Graphical User Interface are:

Components.Each item on a MATLAB GUI is a graphical components. The types of


static elements,menus, toolbars and axes.Graphical control and text boxes arecreted by using
uicontrole , and menus are created by a function uimenu and uicontextmenu.

I. Containers.the components of the GUI must be arranged with in a container, which is


a window on the computer screen.The most common container is a figure.Afigure is
window on the computer screen that has a title bar along the top, and that have
optionally have menus attached.the other types of containers are panels and button
groups.Panels can contains components or other containers, but they do not have a
title bar and cannot have menus attached.Button group are special panels that can
manage group of radio buttons or toggles buttons to ensure that not more than the one
button in the group is on at any time.
II. Callbacks.Finally,there must be some way to perform an action if auser clicks a
mouse on a button or types of information on a key board. A mouse click or a key
press 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 click on a button then that
event must cause the MATLAB code that implement the function of the button to be
executed. The code executed in response to an event is known as callback. There
must be a callback to implement the function of each graphical component of GUI.

Creating and displaying graphical user interface

MATLAB graphical user interface are created using a tool called Guide,GUI
Development Environment.The toolallows the programmer tolay out the GUI,selecting
and aligning the GUI component tobe in it.once the componets are in place, the
programmer can edit their properties:name, color,size,font,text to display, and so forth
when guidesaves the GUI it creates aworking program , including skelton function that
the programmer can modify to placedmpliment the behaviour of the GUI

The basic steps required tocreate aMATLAB GUI are decide

1. what elements are required for the GUI and what the function of each element will be.Make a
rough layout of the components .
2. Using MATLAB toolcalled GUIDE to lay out the component in figure.the size of the figure
and the alignment and specing of components on the figure can be adjusted using the tools
built into guide.
3. Use a MATLAB tool called the Property Inspector to give each component name and to set
the characteristics of each , such as its colour or the text it displays.
4. 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 containsthe GUI layout and the componets of the
GUI;the M-file contains the code to load the figure along with skelton callback function for
each GUI element.
5. Write code to implement the behaviour associated with each callback function.

You might also like