You are on page 1of 15

Behaviour & Numerical Modelling

of Reinforced Concrete Structures

Matlab GUIs
+ example


Ecole Polytechnique ENAC Professor Daniel Kuchma Academic Year 2011-2012

Fédérale de Lausanne IBETON Fabio Brantschen (Teaching Assistant) 7th and 9th semester (Master) + EDCE
 General aspect

 A GUI (Graphical User Interface) is useful for presenting your
final software.
 It also makes it easier to adjust parameters and visualize your
 Give the user a simplified experience running a program.
 Therefore, in this course, you’re kindly ask to return your
Matlab’s assignments and also projects with a GUI…
 … as best as you can!

 Matlab provides Graphical User Interface Development
Environment (GUIDE)
 A Matlab tool used to create GUIs
 To get started, type ‘‘ guide ’’ in the prompt

>> guide GUIDE

 You get a blank form that you can place controls on.
 GUI should be consistent and easy to understand…
 … before you jump in, have a plan of what you want to lay out

Blank GUI
 2 basic questions to correctly design the GUIs
 Do the users always know where they are ?
 Do they always know where to go next ?
 Often, the user will go through the GUI using
 You can switch the tab-order using uistack
 …

Assessing the value of your GUI

 Possible components of a GUI (graphical or static)
Push Button Slider

Radio Button Check Box

Edit Text Static Text

Pop-Up Menu List Box

Toggle Button Table

Axes Panel

Button Group ActiveX Control

 Figures – components are contained in figures

 Callbacks – the functions which perform the required action
when a component is pushed

3 Essential Characteristics
 Even if you do nothing…
 A Callback is performed before user has access to the GUI
 Saving automatically generates an .m file and .fig
 .fig contains the binary GUI layout
 .m contains the code that controls the GUI

 Until here, not so difficult ?!?

GUI Properties
 All components will create in the .m file of the GUI
 An opening function
 Use to generate data used in GUI or specify visual aspects

 Not obligatory to write code !

Opening function
 Most of the components will create in the .m file of the GUI
 A callback function
 Use to define what will happen when the component is selected

 Must write code ! (and the good one…)

Callback function
 GUI that plots a given function

 The Matlab help documentation on GUIs is quite good
 Any website about building Matlab GUIs, like:

MATLAB GUI Tutorial for beginners (English)

Développement efficace des interfaces graphiques (French)

 Unfortunately, specific books only on GUIs don’t exist!

More information
 Todd Wittman « Building a Matlab GUI » (2008)
 Rigo Dicochea « How to create GUI’s in Matlab »
 Simone Deparis, Senior Resarcher and Lecturer in chair of
modelling and scientific computing(CMCS, EPFL)

Thanks for your attention…

Questions ?