Upload
shailie-rai
View
208
Download
4
Embed Size (px)
Citation preview
MATLAB GUI Tutorial
Presented By:
Shailie Rai
2
CONTENTIntroduction
Steps used to build a GUI
Conclusion
3
Introduction to Graphical User Interface (GUI)
It allows the use of icons or other visual indicators to interact with electronic devices, rather than using only text via the command line.
Many tools can be added to the layout area like Push buttons, Edit text, Static text, Axes etc.
4
Steps used to build the GUI
In the Matlab command window write GUIDE then press enter.
Then the following dialog box appears.
Press OK then continue.
5
In the GUI window you can add different types of tools.
This can be done by selecting tools from the component palette at the left side of the Layout Editor and then drag them into the layout area.
6
As I have selected following tools from the palette to develop my program :
AXES PANEL STATIC TEXT EDIT TEXT PUSH BUTTON
7
I have repeated this step until desired number of tools were obtained in the layout area.
8
Then double click each tool to get the property inspector to edit the varies properties of tools eg. PANEL , STATIC TEXT Property Inspector.
Changed the title for Panel as Data
Changed the colour to Red
Changed the Font size to 10.0
9
Delete this and write the desired text
10
And here is the final generated GUIWhen we run the GUI a MATLAB .m file is created along with the fig file
11
Any action that takes place depends upon an event that is occurred on a particular control (tool), for example :
Click on a pushbutton Pressing Enter/Return after entering data into an edit
boxIn a GUI a piece of code or function that executes in
response to events on the tools are called callbacks.To develop the callback function for the push-button
“Carrier1_edit2_Callback”, in the program right click the control to open the context menu , then select
view callbacks --------> callback
12
Generating callback in the program
13
Callback generated
Start writing the code after the comments and repeat this process for the callbacks of different tools as per requirement.
14
Execution of GUI
15
Entering the required fields and clicking on the FSK push button required plot is generated and similar steps are followed for the ASK , PSK push button.
16
Conclusion
GUI helps to make the program interactive to the user so that one can use various tools provided in the Matlab GUI interface to get the desired layout area.
17
THANK YOU