SlideShare a Scribd company logo
Gui in Matlab
Group : 4
Topics
About gui
How to create gui with Guide
How to Create a Simple GUI
Programmatically
What Is a GUI?
A graphical user interface (GUI) is a graphical display in one or more
windows containing controls, called components, that enable a user to perform
interactive tasks.
The user of the GUI does not have to create a script or
type commands at the command line to accomplish the tasks.
Unlike coding
programs to accomplish tasks, the user of a GUI need not understand the
details of how the tasks are performed.
GUI components can include menus, toolbars, push buttons, radio buttons,
list boxes, and sliders—just to name a few. GUIs created using MATLAB
tools can also perform any type of computation, read and write data files,
communicate with other GUIs, and display data as tables or as plots.
Sample Gui figure
What in pervious figure ?
The GUI contains
•An axes component
•Apop-up menu listing three data sets that correspond to MATLAB
functions: peaks, membrane,andsinc
•Astatic text component to label the pop-up menu
•Three buttons that provide different kinds of plots: surface, mesh, and
contour
When you click a push button, the axes component displays the selected data
set using the specified type of 3-D plot
Where Do I Start?
Before starting to construct a GUI you have to design it. At a minimum,
You have to decide:
•Who the GUI users will be
•What you want the GUI to do
•How users will interact with the GUI
•What components the GUI requires to function
When designing any software, you need to understand the purposes a new
GUI needs to satisfy. You or the GUI’s potential users should document user
requirements as completely and precisely as possible before starting or build
it. This includes specifying the inputs, outputs, displays, and behaviors of the
GUI and the application it controls. After you design a GUI, you need to
program each of its controls to operate correctly and consistently. Finally, you
should test the completed or prototype GUI to make sure that it behaves as
intended under realistic conditions. (Or better yet, have someone else test it.)
If testing reveals design or programming flaws, iterate the design until the
GUI works to your satisfaction. The following diagram illustrates the main
aspects of this process.
Ways to Build MATLAB GUI
Use GUIDE (GUI Development Environment), an interactive GUI
construction kit.
-------------------------------------------------------------------
•Create code files that generate GUIs as functions or scripts
(programmatic GUI construction).
What Is GUIDE?
GUIDE, the MATLAB Graphical User Interface Development Environment,
provides a set of tools for creating graphical user interfaces (GUIs).
These
tools greatly simplify the process of laying out and programming GUIs.
Type guide to open
Lay Out the Simple GUI in GUIDE
Open a New GUI in the GUIDE Layout Editor
1-Start GUIDE by typing guide at the MATLAB prompt.
Lay Out the Simple GUI in GUIDE
1-Add the three push buttons to the GUI. Select the push button tool from
the component palette at the left side of the Layout Editor and drag it into
the layout area. Create three buttons, positioning them approximately as
Shown in the following figure
2-Add the remaining components to the GUI.
•Astatic text area
•A pop-up menu
•An axes
Arrange the components as shown in the previous figure. Resize the axes
component to approximately 2-by-2 inches.
Align the Components
If several components have the same parent, you can use the Alignment Tool
to align them to one another. To align the three push buttons:
1Select all three push buttons by pressingCtrland clicking them.
2SelectTools > Align Objects
3-Make these settings in the Alignment Tool:
•Left-aligned in the horizontal direction.
•20 pixels spacing between push buttons in the vertical direction.
4- click ok 4
Label the Push Buttons
SelectView > Property Inspector.
Align the Components
If several components have the same parent, you can use the Alignment Tool
to align them to one another. To align the three push buttons:
1-Select all three push buttons by pressing Ctrl and clicking them.
2-SelectTools > Align Objects.
3-Make these settings in the Alignment Tool:
•Left-aligned in the horizontal direction.
•20 pixels spacing between push buttons in the vertical direction
How to Create a Simple
GUI Programmatically
Create the Simple Programmatic GUI Code File
Almost all MATLAB functions work in GUIs. Many functions add components
to GUIs or modify their behavior, others assist in laying out GUIs, and still
others manage data within GUIs.
When you create the simple programmatic GUI code file, you start by creating
a function file (as opposed to a script file, which contains a sequence of
MATLAB commands but does not define functions).
1-At the MATLAB prompt, type edit. MATLAB opens a blank document in
the Editor.
2-Type the following statement into the Editor. This function statement
is the first line in the file.
function simple_gui2
3-Type these comments into the file following the function statement. They
display at the command line in response to the help command. Follow
them by a blank line, which MATLAB requires to terminate the help text.
% SIMPLE_GUI2 Select a data set from the pop-up menu, then
% click one of the plot-type push buttons. Clicking the button
% plots the selected data in the axes.
(Leave a blank line here)
4-Add an end statement at the end of the file. This end statement matches
The function statement. Your file now looks like this.
function simple_gui2
% SIMPLE_GUI2 Select a data set from the pop-up menu, then
% click one of the plot-type push buttons. Clicking the button
% plots the selected data in the axes.
end
5-Save the file in your current folder or at a location that is on your MATLAB
path.
The next section, “Lay Out the Simple Programmatic GUI” on page 3-6, shows
you how to add components to your GUI.
The next section, “Lay Out the Simple Programmatic GUI” on page 3-6, shows
you how to add components to your GUI.
Create a Figure for a Programmatic GUI
In MATLAB software, a GUI is a figure. This first step creates the figure and
Positionsiton the screen.It also makes the GUI invisible so that the GUI
user cannot see the components being added or initialized. When the GUI has
all its components and is initialized, the example makes it visible. Add the
following lines before the end statement currently in your file:
% Create and then hide the GUI as it is being constructed.
f = figure('Visible','off','Position',[360,500,450,285]);
The call to the figure function uses two property/value pairs. The Position
property is a four-element vector that specifies the location of the GUI on the
screen and its size: [distance from left, distance from bottom, width, height].
Default units are pixels.
The next topic, “Add Components to a Programmatic GUI” , shows
you how to add the push buttons, axes, and other components to the GUI
1-Add the three push buttons to your GUI by adding these statements to your
code file following the call tofigure.
% Construct the components.
hsurf = uicontrol('Style','pushbutton',...
'String','Surf','Position',[315,220,70,25]);
hmesh = uicontrol('Style','pushbutton',...
'String','Mesh','Position',[315,180,70,25]);
hcontour = uicontrol('Style','pushbutton',...
'String','Countour','Position',[315,135,70,25]);
These statements use the uicontrol function to create the push buttons.
Each statement uses a series of property/value pairs to define a push
button.
2-Add the pop-up menu and its label to your GUI by adding these statements
to the code file following the push button definitions.
hpopup = uicontrol('Style','popupmenu',...
'String',{'Peaks','Membrane','Sinc'},...
'Position',[300,50,100,25]);
htext = uicontrol('Style','text','String','Select Data',...
'Position',[325,90,60,15]);
3-Add the axes to the GUI by adding this statement to the code file. Set
theUnitsproperty to pixels so that it has the same units as the other
components.
ha = axes('Units','pixels','Position',[50,60,200,185]);
4-Align all components except the axes along their centers with the
following
statement. Add it to the code file following all the component
definitions.
align([hsurf,hmesh,hcontour,htext,hpopup],'Center','None');
5-Make your GUI visible by adding this command following thealign
command.
%Make the GUI visible.
set(f,'Visible','on')
6-This is what your code file should now look like:
6-This is what your code file should now look like:
function simple_gui2
% SIMPLE_GUI2 Select a data set from the pop-up menu, then
% click one of the plot-type push buttons. Clicking the button
% plots the selected data in the axes.
% Create and then hide the GUI as it is being constructed.
f = figure('Visible','off','Position',[360,500,450,285]);
% Construct the components.
hsurf = uicontrol('Style','pushbutton','String','Surf',...
'Position',[315,220,70,25]);
hmesh = uicontrol('Style','pushbutton','String','Mesh',...
'Position',[315,180,70,25]);
hcontour = uicontrol('Style','pushbutton',...
'String','Countour',...
'Position',[315,135,70,25]);
htext = uicontrol('Style','text','String','Select Data',...
'Position',[325,90,60,15]);
hpopup = uicontrol('Style','popupmenu',...
% Construct the components.
hsurf = uicontrol('Style','pushbutton','String','Surf',...
'Position',[315,220,70,25]);
hmesh = uicontrol('Style','pushbutton','String','Mesh',...
'Position',[315,180,70,25]);
hcontour = uicontrol('Style','pushbutton',...
'String','Countour',...
'Position',[315,135,70,25]);
htext = uicontrol('Style','text','String','Select Data',...
'Position',[325,90,60,15]);
hpopup = uicontrol('Style','popupmenu',...
'String',{'Peaks','Membrane','Sinc'},...
'Position',[300,50,100,25]);
ha = axes('Units','Pixels','Position',[50,60,200,185]);
align([hsurf,hmesh,hcontour,htext,hpopup],'Center','None');
%Make the GUI visible.
set(f,'Visible','on')
end

More Related Content

What's hot

Domain object model
Domain object modelDomain object model
Domain object model
university of education,Lahore
 
5G Network Architecture and FMC
5G Network Architecture and FMC5G Network Architecture and FMC
5G Network Architecture and FMC
ITU
 
The Network Layer
The Network LayerThe Network Layer
The Network Layer
adil raja
 
Base Station Antenna needs for the 5G RAN
Base Station Antenna needs for the 5G RANBase Station Antenna needs for the 5G RAN
Base Station Antenna needs for the 5G RAN
3G4G
 
Ppt 11 - netopeer
Ppt   11 - netopeerPpt   11 - netopeer
Ppt 11 - netopeer
udhayakumarc1
 
Mobile Radio Propagation
Mobile Radio PropagationMobile Radio Propagation
Mobile Radio Propagation
Izah Asmadi
 
Edge detection
Edge detectionEdge detection
Edge detection
Thùy Bùi
 
Evolution Of Communication Networks
Evolution Of Communication NetworksEvolution Of Communication Networks
Evolution Of Communication Networks
Amogh Gupta
 
Computer networks wireless lan,ieee-802.11,bluetooth
Computer networks  wireless lan,ieee-802.11,bluetoothComputer networks  wireless lan,ieee-802.11,bluetooth
Computer networks wireless lan,ieee-802.11,bluetooth
Deepak John
 
Cellular technology overview
Cellular technology overviewCellular technology overview
Cellular technology overview
Lee Chang Fatt
 
SWITCHING SYSTEM SOFTWARE
SWITCHING SYSTEM SOFTWARESWITCHING SYSTEM SOFTWARE
SWITCHING SYSTEM SOFTWARE
ASFIASULTANA4
 
Chapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9eChapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9eadpeer
 
network monitoring system ppt
network monitoring system pptnetwork monitoring system ppt
network monitoring system pptashutosh rai
 
SPACE DIVISION MULTIPLEXING (SDMA)
SPACE DIVISION MULTIPLEXING (SDMA)SPACE DIVISION MULTIPLEXING (SDMA)
SPACE DIVISION MULTIPLEXING (SDMA)
Syed M.Jehanzeb Jafri
 
Snooping TCP
Snooping TCPSnooping TCP
Snooping TCP
Sushant Kushwaha
 
SPCC:System programming and compiler construction
SPCC:System programming and compiler constructionSPCC:System programming and compiler construction
SPCC:System programming and compiler construction
mohdumaira1
 
Radio resource management in wcdma
Radio resource management in wcdmaRadio resource management in wcdma
Radio resource management in wcdma
Naveen Jakhar, I.T.S
 
Wireless transmission
Wireless transmissionWireless transmission
Wireless transmissionSaba Rathinam
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
barney92
 
Wireless LAN and bluetooth technology
Wireless LAN and bluetooth technologyWireless LAN and bluetooth technology
Wireless LAN and bluetooth technology
RAVIKIRAN ANANDE
 

What's hot (20)

Domain object model
Domain object modelDomain object model
Domain object model
 
5G Network Architecture and FMC
5G Network Architecture and FMC5G Network Architecture and FMC
5G Network Architecture and FMC
 
The Network Layer
The Network LayerThe Network Layer
The Network Layer
 
Base Station Antenna needs for the 5G RAN
Base Station Antenna needs for the 5G RANBase Station Antenna needs for the 5G RAN
Base Station Antenna needs for the 5G RAN
 
Ppt 11 - netopeer
Ppt   11 - netopeerPpt   11 - netopeer
Ppt 11 - netopeer
 
Mobile Radio Propagation
Mobile Radio PropagationMobile Radio Propagation
Mobile Radio Propagation
 
Edge detection
Edge detectionEdge detection
Edge detection
 
Evolution Of Communication Networks
Evolution Of Communication NetworksEvolution Of Communication Networks
Evolution Of Communication Networks
 
Computer networks wireless lan,ieee-802.11,bluetooth
Computer networks  wireless lan,ieee-802.11,bluetoothComputer networks  wireless lan,ieee-802.11,bluetooth
Computer networks wireless lan,ieee-802.11,bluetooth
 
Cellular technology overview
Cellular technology overviewCellular technology overview
Cellular technology overview
 
SWITCHING SYSTEM SOFTWARE
SWITCHING SYSTEM SOFTWARESWITCHING SYSTEM SOFTWARE
SWITCHING SYSTEM SOFTWARE
 
Chapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9eChapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9e
 
network monitoring system ppt
network monitoring system pptnetwork monitoring system ppt
network monitoring system ppt
 
SPACE DIVISION MULTIPLEXING (SDMA)
SPACE DIVISION MULTIPLEXING (SDMA)SPACE DIVISION MULTIPLEXING (SDMA)
SPACE DIVISION MULTIPLEXING (SDMA)
 
Snooping TCP
Snooping TCPSnooping TCP
Snooping TCP
 
SPCC:System programming and compiler construction
SPCC:System programming and compiler constructionSPCC:System programming and compiler construction
SPCC:System programming and compiler construction
 
Radio resource management in wcdma
Radio resource management in wcdmaRadio resource management in wcdma
Radio resource management in wcdma
 
Wireless transmission
Wireless transmissionWireless transmission
Wireless transmission
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Wireless LAN and bluetooth technology
Wireless LAN and bluetooth technologyWireless LAN and bluetooth technology
Wireless LAN and bluetooth technology
 

Viewers also liked

GUI in Matlab - 1
GUI in Matlab - 1GUI in Matlab - 1
GUI in Matlab - 1
Sahil Potnis
 
Matlab GUI
Matlab GUIMatlab GUI
Matlab GUI
Matlab GUIMatlab GUI
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
Bilal Amjad
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
Aparna Reddy
 
Muhammad rizwan aqeel rlp.ppt
Muhammad rizwan aqeel rlp.pptMuhammad rizwan aqeel rlp.ppt
Muhammad rizwan aqeel rlp.pptM Rizwan Aqeel
 
Natural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking ToolsNatural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking Tools
Lukas Renggli
 
TIP_E-Conversion_System
TIP_E-Conversion_SystemTIP_E-Conversion_System
TIP_E-Conversion_SystemRana Saini
 
MATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLAB
MATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLABMATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLAB
MATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLABASHOKKUMAR RAMAR
 
Presen_Segmentation
Presen_SegmentationPresen_Segmentation
Presen_SegmentationVikas Goyal
 
Text detection and recognition from natural scenes
Text detection and recognition from natural scenesText detection and recognition from natural scenes
Text detection and recognition from natural scenes
hemanthmcqueen
 
DSBW Final Exam (Spring Sementer 2010)
DSBW Final Exam (Spring Sementer 2010)DSBW Final Exam (Spring Sementer 2010)
DSBW Final Exam (Spring Sementer 2010)Carles Farré
 
Error control coding
Error control codingError control coding
Error control coding
Mohammad Bappy
 
Devanagari Character Recognition
Devanagari Character RecognitionDevanagari Character Recognition
Devanagari Character Recognition
Pulkit Goyal
 
Matlab Untuk Pengolahan Citra
Matlab Untuk Pengolahan CitraMatlab Untuk Pengolahan Citra
Matlab Untuk Pengolahan Citra
arifgator
 
Praktik dengan matlab
Praktik dengan matlabPraktik dengan matlab
Praktik dengan matlab
Syafrizal
 
Neural network in matlab
Neural network in matlab Neural network in matlab
Neural network in matlab
Fahim Khan
 
Pengolahan Citra Digital Dengan Menggunakan MATLAB
Pengolahan Citra Digital Dengan Menggunakan MATLABPengolahan Citra Digital Dengan Menggunakan MATLAB
Pengolahan Citra Digital Dengan Menggunakan MATLAB
Simesterious TheMaster
 

Viewers also liked (20)

GUI in Matlab - 1
GUI in Matlab - 1GUI in Matlab - 1
GUI in Matlab - 1
 
Matlab GUI
Matlab GUIMatlab GUI
Matlab GUI
 
Matlab GUI
Matlab GUIMatlab GUI
Matlab GUI
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
 
Muhammad rizwan aqeel rlp.ppt
Muhammad rizwan aqeel rlp.pptMuhammad rizwan aqeel rlp.ppt
Muhammad rizwan aqeel rlp.ppt
 
Natural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking ToolsNatural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking Tools
 
TIP_E-Conversion_System
TIP_E-Conversion_SystemTIP_E-Conversion_System
TIP_E-Conversion_System
 
MATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLAB
MATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLABMATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLAB
MATLAB TRAINING COURSE IN CHENNAI@MAASTECH/MATLAB
 
Presen_Segmentation
Presen_SegmentationPresen_Segmentation
Presen_Segmentation
 
Text detection and recognition from natural scenes
Text detection and recognition from natural scenesText detection and recognition from natural scenes
Text detection and recognition from natural scenes
 
DSBW Final Exam (Spring Sementer 2010)
DSBW Final Exam (Spring Sementer 2010)DSBW Final Exam (Spring Sementer 2010)
DSBW Final Exam (Spring Sementer 2010)
 
Error control coding
Error control codingError control coding
Error control coding
 
Lecture 09: Localization and Mapping III
Lecture 09: Localization and Mapping IIILecture 09: Localization and Mapping III
Lecture 09: Localization and Mapping III
 
Devanagari Character Recognition
Devanagari Character RecognitionDevanagari Character Recognition
Devanagari Character Recognition
 
Matlab Untuk Pengolahan Citra
Matlab Untuk Pengolahan CitraMatlab Untuk Pengolahan Citra
Matlab Untuk Pengolahan Citra
 
Modul praktikum pengolahan citra digital
Modul praktikum pengolahan citra digitalModul praktikum pengolahan citra digital
Modul praktikum pengolahan citra digital
 
Praktik dengan matlab
Praktik dengan matlabPraktik dengan matlab
Praktik dengan matlab
 
Neural network in matlab
Neural network in matlab Neural network in matlab
Neural network in matlab
 
Pengolahan Citra Digital Dengan Menggunakan MATLAB
Pengolahan Citra Digital Dengan Menggunakan MATLABPengolahan Citra Digital Dengan Menggunakan MATLAB
Pengolahan Citra Digital Dengan Menggunakan MATLAB
 

Similar to Gui in matlab :

intro_gui
intro_guiintro_gui
intro_gui
filipb2
 
Howtouse gui _sinmatlab
Howtouse gui _sinmatlabHowtouse gui _sinmatlab
Howtouse gui _sinmatlab
M Ahsan Khan
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile services
David Voyles
 
2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
William Lee
 
GUI ICGST VERY USEFULl.pdf
GUI ICGST VERY USEFULl.pdfGUI ICGST VERY USEFULl.pdf
GUI ICGST VERY USEFULl.pdf
AshaLatha456489
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS app
Ketan Raval
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
marwaeng
 
User Tutorial
User TutorialUser Tutorial
User Tutorial
Chris Ford
 
Programming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI ApplicationProgramming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI Application
Mahmoud Samir Fayed
 
Visual basic
Visual basicVisual basic
Visual basic
mafffffe19
 
Publication Non Visual Components
Publication Non Visual ComponentsPublication Non Visual Components
Publication Non Visual Components
satyres
 
ArduinoWorkshop2.pdf
ArduinoWorkshop2.pdfArduinoWorkshop2.pdf
ArduinoWorkshop2.pdf
PedramKashiani
 
222066369 clad-study-guide
222066369 clad-study-guide222066369 clad-study-guide
222066369 clad-study-guide
homeworkping9
 
Model builder in ARC GIS
Model builder in ARC GISModel builder in ARC GIS
Model builder in ARC GIS
KU Leuven
 
Matlab Assignment Help
Matlab Assignment HelpMatlab Assignment Help
Matlab Assignment Help
Matlab Assignment Experts
 
Programming Without Coding Technology (PWCT) - Center Window
Programming Without Coding Technology (PWCT) - Center WindowProgramming Without Coding Technology (PWCT) - Center Window
Programming Without Coding Technology (PWCT) - Center Window
Mahmoud Samir Fayed
 
GUI_part_1.pptx
GUI_part_1.pptxGUI_part_1.pptx
GUI_part_1.pptx
Parasuraman43
 

Similar to Gui in matlab : (20)

intro_gui
intro_guiintro_gui
intro_gui
 
Vb%20 tutorial
Vb%20 tutorialVb%20 tutorial
Vb%20 tutorial
 
Howtouse gui _sinmatlab
Howtouse gui _sinmatlabHowtouse gui _sinmatlab
Howtouse gui _sinmatlab
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile services
 
2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
 
GUI ICGST VERY USEFULl.pdf
GUI ICGST VERY USEFULl.pdfGUI ICGST VERY USEFULl.pdf
GUI ICGST VERY USEFULl.pdf
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS app
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
User Tutorial
User TutorialUser Tutorial
User Tutorial
 
Swift
SwiftSwift
Swift
 
Programming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI ApplicationProgramming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI Application
 
Visual basic
Visual basicVisual basic
Visual basic
 
Publication Non Visual Components
Publication Non Visual ComponentsPublication Non Visual Components
Publication Non Visual Components
 
ArduinoWorkshop2.pdf
ArduinoWorkshop2.pdfArduinoWorkshop2.pdf
ArduinoWorkshop2.pdf
 
222066369 clad-study-guide
222066369 clad-study-guide222066369 clad-study-guide
222066369 clad-study-guide
 
Model builder in ARC GIS
Model builder in ARC GISModel builder in ARC GIS
Model builder in ARC GIS
 
Matlab Assignment Help
Matlab Assignment HelpMatlab Assignment Help
Matlab Assignment Help
 
Programming Without Coding Technology (PWCT) - Center Window
Programming Without Coding Technology (PWCT) - Center WindowProgramming Without Coding Technology (PWCT) - Center Window
Programming Without Coding Technology (PWCT) - Center Window
 
GUI_part_1.pptx
GUI_part_1.pptxGUI_part_1.pptx
GUI_part_1.pptx
 

Recently uploaded

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 

Recently uploaded (20)

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 

Gui in matlab :

  • 2. Topics About gui How to create gui with Guide How to Create a Simple GUI Programmatically
  • 3. What Is a GUI? A graphical user interface (GUI) is a graphical display in one or more windows containing controls, called components, that enable a user to perform interactive tasks. The user of the GUI does not have to create a script or type commands at the command line to accomplish the tasks. Unlike coding programs to accomplish tasks, the user of a GUI need not understand the details of how the tasks are performed. GUI components can include menus, toolbars, push buttons, radio buttons, list boxes, and sliders—just to name a few. GUIs created using MATLAB tools can also perform any type of computation, read and write data files, communicate with other GUIs, and display data as tables or as plots.
  • 5. What in pervious figure ? The GUI contains •An axes component •Apop-up menu listing three data sets that correspond to MATLAB functions: peaks, membrane,andsinc •Astatic text component to label the pop-up menu •Three buttons that provide different kinds of plots: surface, mesh, and contour When you click a push button, the axes component displays the selected data set using the specified type of 3-D plot
  • 6. Where Do I Start? Before starting to construct a GUI you have to design it. At a minimum, You have to decide: •Who the GUI users will be •What you want the GUI to do •How users will interact with the GUI •What components the GUI requires to function When designing any software, you need to understand the purposes a new GUI needs to satisfy. You or the GUI’s potential users should document user requirements as completely and precisely as possible before starting or build it. This includes specifying the inputs, outputs, displays, and behaviors of the GUI and the application it controls. After you design a GUI, you need to program each of its controls to operate correctly and consistently. Finally, you should test the completed or prototype GUI to make sure that it behaves as intended under realistic conditions. (Or better yet, have someone else test it.) If testing reveals design or programming flaws, iterate the design until the GUI works to your satisfaction. The following diagram illustrates the main aspects of this process.
  • 7. Ways to Build MATLAB GUI Use GUIDE (GUI Development Environment), an interactive GUI construction kit. ------------------------------------------------------------------- •Create code files that generate GUIs as functions or scripts (programmatic GUI construction).
  • 8. What Is GUIDE? GUIDE, the MATLAB Graphical User Interface Development Environment, provides a set of tools for creating graphical user interfaces (GUIs). These tools greatly simplify the process of laying out and programming GUIs. Type guide to open Lay Out the Simple GUI in GUIDE Open a New GUI in the GUIDE Layout Editor 1-Start GUIDE by typing guide at the MATLAB prompt.
  • 9. Lay Out the Simple GUI in GUIDE
  • 10.
  • 11.
  • 12. 1-Add the three push buttons to the GUI. Select the push button tool from the component palette at the left side of the Layout Editor and drag it into the layout area. Create three buttons, positioning them approximately as Shown in the following figure 2-Add the remaining components to the GUI. •Astatic text area •A pop-up menu •An axes Arrange the components as shown in the previous figure. Resize the axes component to approximately 2-by-2 inches. Align the Components If several components have the same parent, you can use the Alignment Tool to align them to one another. To align the three push buttons: 1Select all three push buttons by pressingCtrland clicking them. 2SelectTools > Align Objects
  • 13. 3-Make these settings in the Alignment Tool: •Left-aligned in the horizontal direction. •20 pixels spacing between push buttons in the vertical direction. 4- click ok 4 Label the Push Buttons SelectView > Property Inspector.
  • 14. Align the Components If several components have the same parent, you can use the Alignment Tool to align them to one another. To align the three push buttons: 1-Select all three push buttons by pressing Ctrl and clicking them. 2-SelectTools > Align Objects. 3-Make these settings in the Alignment Tool: •Left-aligned in the horizontal direction. •20 pixels spacing between push buttons in the vertical direction
  • 15. How to Create a Simple GUI Programmatically Create the Simple Programmatic GUI Code File Almost all MATLAB functions work in GUIs. Many functions add components to GUIs or modify their behavior, others assist in laying out GUIs, and still others manage data within GUIs. When you create the simple programmatic GUI code file, you start by creating a function file (as opposed to a script file, which contains a sequence of MATLAB commands but does not define functions).
  • 16. 1-At the MATLAB prompt, type edit. MATLAB opens a blank document in the Editor. 2-Type the following statement into the Editor. This function statement is the first line in the file. function simple_gui2 3-Type these comments into the file following the function statement. They display at the command line in response to the help command. Follow them by a blank line, which MATLAB requires to terminate the help text. % SIMPLE_GUI2 Select a data set from the pop-up menu, then % click one of the plot-type push buttons. Clicking the button % plots the selected data in the axes. (Leave a blank line here)
  • 17. 4-Add an end statement at the end of the file. This end statement matches The function statement. Your file now looks like this. function simple_gui2 % SIMPLE_GUI2 Select a data set from the pop-up menu, then % click one of the plot-type push buttons. Clicking the button % plots the selected data in the axes. end 5-Save the file in your current folder or at a location that is on your MATLAB path. The next section, “Lay Out the Simple Programmatic GUI” on page 3-6, shows you how to add components to your GUI. The next section, “Lay Out the Simple Programmatic GUI” on page 3-6, shows you how to add components to your GUI.
  • 18. Create a Figure for a Programmatic GUI In MATLAB software, a GUI is a figure. This first step creates the figure and Positionsiton the screen.It also makes the GUI invisible so that the GUI user cannot see the components being added or initialized. When the GUI has all its components and is initialized, the example makes it visible. Add the following lines before the end statement currently in your file: % Create and then hide the GUI as it is being constructed. f = figure('Visible','off','Position',[360,500,450,285]); The call to the figure function uses two property/value pairs. The Position property is a four-element vector that specifies the location of the GUI on the screen and its size: [distance from left, distance from bottom, width, height]. Default units are pixels. The next topic, “Add Components to a Programmatic GUI” , shows you how to add the push buttons, axes, and other components to the GUI
  • 19. 1-Add the three push buttons to your GUI by adding these statements to your code file following the call tofigure. % Construct the components. hsurf = uicontrol('Style','pushbutton',... 'String','Surf','Position',[315,220,70,25]); hmesh = uicontrol('Style','pushbutton',... 'String','Mesh','Position',[315,180,70,25]); hcontour = uicontrol('Style','pushbutton',... 'String','Countour','Position',[315,135,70,25]); These statements use the uicontrol function to create the push buttons. Each statement uses a series of property/value pairs to define a push button.
  • 20. 2-Add the pop-up menu and its label to your GUI by adding these statements to the code file following the push button definitions. hpopup = uicontrol('Style','popupmenu',... 'String',{'Peaks','Membrane','Sinc'},... 'Position',[300,50,100,25]); htext = uicontrol('Style','text','String','Select Data',... 'Position',[325,90,60,15]); 3-Add the axes to the GUI by adding this statement to the code file. Set theUnitsproperty to pixels so that it has the same units as the other components. ha = axes('Units','pixels','Position',[50,60,200,185]);
  • 21. 4-Align all components except the axes along their centers with the following statement. Add it to the code file following all the component definitions. align([hsurf,hmesh,hcontour,htext,hpopup],'Center','None'); 5-Make your GUI visible by adding this command following thealign command. %Make the GUI visible. set(f,'Visible','on') 6-This is what your code file should now look like:
  • 22. 6-This is what your code file should now look like: function simple_gui2 % SIMPLE_GUI2 Select a data set from the pop-up menu, then % click one of the plot-type push buttons. Clicking the button % plots the selected data in the axes. % Create and then hide the GUI as it is being constructed. f = figure('Visible','off','Position',[360,500,450,285]); % Construct the components. hsurf = uicontrol('Style','pushbutton','String','Surf',... 'Position',[315,220,70,25]); hmesh = uicontrol('Style','pushbutton','String','Mesh',... 'Position',[315,180,70,25]); hcontour = uicontrol('Style','pushbutton',... 'String','Countour',... 'Position',[315,135,70,25]); htext = uicontrol('Style','text','String','Select Data',... 'Position',[325,90,60,15]); hpopup = uicontrol('Style','popupmenu',...
  • 23. % Construct the components. hsurf = uicontrol('Style','pushbutton','String','Surf',... 'Position',[315,220,70,25]); hmesh = uicontrol('Style','pushbutton','String','Mesh',... 'Position',[315,180,70,25]); hcontour = uicontrol('Style','pushbutton',... 'String','Countour',... 'Position',[315,135,70,25]); htext = uicontrol('Style','text','String','Select Data',... 'Position',[325,90,60,15]); hpopup = uicontrol('Style','popupmenu',... 'String',{'Peaks','Membrane','Sinc'},... 'Position',[300,50,100,25]); ha = axes('Units','Pixels','Position',[50,60,200,185]); align([hsurf,hmesh,hcontour,htext,hpopup],'Center','None'); %Make the GUI visible. set(f,'Visible','on') end