0% found this document useful (0 votes)
3 views23 pages

Matlab Lect 15

The document discusses the creation and components of a Graphical User Interface (GUI) in MATLAB, emphasizing its role in enhancing user experience through visual elements like buttons and sliders. It outlines the main components required to build a GUI, including figures, panels, and callbacks, and provides example code for button functionalities. Additionally, it briefly mentions different filter functions in MATLAB, though details on filters are not elaborated.

Uploaded by

Rahmath Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views23 pages

Matlab Lect 15

The document discusses the creation and components of a Graphical User Interface (GUI) in MATLAB, emphasizing its role in enhancing user experience through visual elements like buttons and sliders. It outlines the main components required to build a GUI, including figures, panels, and callbacks, and provides example code for button functionalities. Additionally, it briefly mentions different filter functions in MATLAB, though details on filters are not elaborated.

Uploaded by

Rahmath Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

GUI (GRAPHICAL USER

INTERFACE) IN MATLAB,
DIFFERENT FILTERS FUNCTION IN
MATLAB.

Lecture 15
MATLAB GRAPHICAL USER INTERFACE

 A graphical user interface (GUI) is a visual

interface to a program.

 A good GUI can make applications more

comfortable to use by providing them with a

consistent appearance and with spontaneous

controls such as pushbuttons, edit boxes, list

boxes, sliders, and menus.


HOW DOES GRAPHICAL USER
INTERFACE WORK?
The three principal components required
to create a MATLAB graphical user
interface are:

1. Components
2. Containers
3. Callbacks
COMPONENTS OF GUI
 Figure
 Panel
 Button Group
 Pushbutton
 Toggle Button
 Radio Button
 Checkbox
 Edit Box
 List Box
 Popup Menus
 Slider
 Frame
 Text Field
 Menu Items
 Context Menus
 Toolbar
 Toolbar
 Toolbar Toggle
CODE
% --- Executes on button press in BtnZero.
function BtnZero_Callback (hObject, eventdata, handles)
% hObject handle to BtnZero (see GCBO)
% eventdata reserved - to be described in a future version of
MATLAB
% handles structure with manage and user data (see GUIDATA)
textString=get (handles. edit1,'string');
textString=strcat(textString,'0');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnOne.


function BtnOne_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'1');
set (handles. edit1,'string', textString);
CODE CONT…
% --- Executes on button press in BtnTwo.
function BtnTwo_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'2');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnThree.


function BtnThree_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'3');
set(handles. edit1,'string', textString);

% --- Executes on button press in BtnFour.


function BtnFour_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'4');
set (handles. edit1,'string',textString);
CODE CONT…
% --- Executes on button press in BtnFive.
function BtnFive_Callback(hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'5');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnSix.


function BtnSix_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'6');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnSeven.


function BtnSeven_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'7');
set (handles. edit1,'string', textString);
CODE CONT…
% --- Executes on button press in BtnEight.
function BtnEight_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'8');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnNine.


function BtnNine_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'9');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnPlus.


function BtnPlus_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'+');
set(handles. edit1,'string', textString);
CODE CONT…
% --- Executes on button press in BtnMinus.
function BtnMinus_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'-');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnMul.


function BtnMul_Callback (hObject, eventdata, handles)
textString=strcat(textString,'*');
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnDivide.


function BtnDivide_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=strcat(textString,'/');
set (handles. edit1,'string', textString);
CODE CONT…

% --- Executes on button press in BtnCalc.


function BtnCalc_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
textString=eval(textString);
set (handles. edit1,'string', textString);

% --- Executes on button press in BtnClear.


function BtnClear_Callback (hObject, eventdata, handles)
textString=get (handles. edit1,'string');
set (handles. edit1,'string','');
OUTPUT
DIFFERENT FILTERS FUNCTION
REFERENCE
 https://www.slideshare.net/slideshow/matlab-
gui/2679567#15
 https://slideplayer.com/slide/13041807/

You might also like