0% found this document useful (0 votes)
64 views7 pages

Fuzzy Logic and Applications: Building GUI Interfaces in Matlab

The document describes how to build a graphical user interface (GUI) in MATLAB. It involves using the GUIDE tool to layout buttons, text boxes, and other elements. Each GUI component has callback functions that are executed when clicked. For example, clicking the "1" button will call a function that adds the number 1 to the displayed text. The "=" button will evaluate the text as a mathematical expression when clicked. Overall, the document provides a step-by-step guide to designing a simple calculator GUI in MATLAB as an example.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views7 pages

Fuzzy Logic and Applications: Building GUI Interfaces in Matlab

The document describes how to build a graphical user interface (GUI) in MATLAB. It involves using the GUIDE tool to layout buttons, text boxes, and other elements. Each GUI component has callback functions that are executed when clicked. For example, clicking the "1" button will call a function that adds the number 1 to the displayed text. The "=" button will evaluate the text as a mathematical expression when clicked. Overall, the document provides a step-by-step guide to designing a simple calculator GUI in MATLAB as an example.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Designing GUI in Matlab

HOME
EE509
Fuzzy Logic and applications
Building GUI interfaces in Matlab

MATLAB
This example shows how to build user GUI in Matlab. We will build a simple
calculator to do that.

Start gui builder by typing


>>guide

Select "Blank GUI", click OK

The GUI window will open

http://www.intelligent-systems.info/classes/ee509/gui.htm[11/29/2011 12:33:16 PM]


Designing GUI in Matlab

Resize the design window.


Using the pallette on the left, drag and drop, resize and position the canvas,
buttons, and static text windows.

http://www.intelligent-systems.info/classes/ee509/gui.htm[11/29/2011 12:33:16 PM]


Designing GUI in Matlab

Double-click on an object to open the properties dialog. Change the captions on


the buttons and remove "Static Text" string from the text window. Set the font
size 30 for the text windows and change horizontal alingment to "right."

http://www.intelligent-systems.info/classes/ee509/gui.htm[11/29/2011 12:33:16 PM]


Designing GUI in Matlab

The GUI is finished. Save the work.


The rest of the design process will take care of the functionality provided by each
GUI component.

http://www.intelligent-systems.info/classes/ee509/gui.htm[11/29/2011 12:33:16 PM]


Designing GUI in Matlab

Open the matlab editor by typing


>>edit foo.m
where foo.m is the name of your design

Each time you press a button, a callback function is executed.


For example, in this particular case, a click on button "1" will call the following
function:

This function will have to be modified to provide required functionality.


Buttons "0"-"9","+","-","*","/" will add corresponding symbol to the text string
displayed on the top. For button "1" the code will look like:

http://www.intelligent-systems.info/classes/ee509/gui.htm[11/29/2011 12:33:16 PM]


Designing GUI in Matlab

Do the same for the rest of the buttons, except "=".


The "=" button should evaluate the text string in the text window and return the
result.

Now the calculator is ready to use. Of course, it misses a lot of functionality, but

http://www.intelligent-systems.info/classes/ee509/gui.htm[11/29/2011 12:33:16 PM]


Designing GUI in Matlab

BACK
TO TOP
Contact the instructor at: esazonov@clarkson.edu
Last
Updated:
08/25/03

http://www.intelligent-systems.info/classes/ee509/gui.htm[11/29/2011 12:33:16 PM]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy