Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy

Slides:



Advertisements
Similar presentations
© by Pearson Education, Inc. All Rights Reserved.
Advertisements

Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros
1 How to create GUI's in MatLAB Rigo Dicochea. 2 Introduction Graphical User Interface (GUI) MatLab provides Graphical User Interface Development Environment(GUIDE)
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Matlab GUIs Making Matlab Interactive. Today’s topics What is a GUI? How does a GUI work? Where do you begin? Ways to build MATLAB GUIs.
Access Tutorial 10 Automating Tasks with Macros
Digital Image Processing Lecture3: Introduction to MATLAB.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Programming a GUI Hanan sedaghat pisheh. For calling GUI, we need a function with no inputs or outputs First We create a m.file m file has the same name.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
A short intermission about function handles and cell arrays A MATLAB function may be referenced by a handle. >> sphere(100)
Introduction to the Graphical User Interface (GUI) in MATLAB
Matlab GUIs GUIDE.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Chapter 8: Writing Graphical User Interfaces
IE 411/511: Visual Programming for Industrial Applications
Creating a Web Site to Gather Data and Conduct Research.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Introduction to Matlab & Data Analysis
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
3461A Readings from the Swing Tutorial. 3461A Overview  The follow is the Table of Contents from the trail “Creating a GUI with JFC/Swing” in the “The.
S511 Session 7, IU-SLIS 1 DB Implementation: MS Access Forms.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
Graphical User Interfaces I The central station is the bubble gum planet with 280 pounds of clay and three head phone lines that come out and orbit the.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Introduction to MATLAB Damon Tomlin February 22, 2008 Lecture 3: Data Visualization & User Interfaces.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Introduction to Matlab & Data Analysis 2015 In this tutorial we will: Build a practical application using GUIDE Learn more about graphical user interface.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VII Introduction to SIMULINK Rajeev Madazhy
Software 3 See Edmodo for images Group name: topcat Group code: i4qf9a 11/03/11.
Creating User Interfaces Chapter 13 CSCI CSCI 1302 – Creating User Interfaces2 Outline Introduction Common Features of Swing GUI Components Buttons.
EGR 115 Introduction to Computing for Engineers
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
Lecture (7) Introduction to GUI Eng. Osama Talaat 1.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
More Matlab Graphics and GUI Graphics subplots some useful commands 3D graphics GUI GUI controls The callback property Other essential properties.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Dive Into® Visual Basic 2010 Express
Topics Graphical User Interfaces Using the tkinter Module
Graphical User Interface in MATLAB
Chapter Topics 15.1 Graphical User Interfaces
1. Introduction to Visual Basic
Chap 7. Building Java Graphical User Interfaces
More on Graphical User Interfaces
Graphical User Interfaces -- Introduction
Chapter 15: GUI Applications & Event-Driven Programming
Creating Additional Input Items
Presentation transcript:

Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU

Department of Mechanical Engineering, LSUSession VII Last Session….  Introduction to Simulink  Solving simple problems using Simulink

Department of Mechanical Engineering, LSUSession VII Session VII Outline….  Introduction to GUI using MATLAB  Creating a GUI using MATLAB

Department of Mechanical Engineering, LSUSession VII GUI….. A graphical user interface (GUI) is a user interface built with graphical objects — the components of the GUI — such as buttons, text fields, sliders, and menus. If the GUI is designed well-designed, it should be intuitively obvious to the user how its components function.

Department of Mechanical Engineering, LSUSession VII Creating GUI’s with GUIDE….. MATLAB implements GUIs as figure windows containing various uicontrol objects. You must program each object to perform the action you intend it to do when a user activates the component. In addition, you must be able to save and run your GUI. All of these tasks are simplified by GUIDE, the MATLAB graphical user interface development environment.

Department of Mechanical Engineering, LSUSession VII Using GUIDE…. GUIDE provides several templates, which simple examples that you can modify to create your own GUIs. The templates are fully functional GUIs: their callbacks are already programmed. You can view the code for these callbacks to see how they work, and then modify the callbacks for your own purposes. You can access the templates in two ways: Start GUIDE by entering guide at the MATLAB prompt. If GUIDE is already open, select New from the File menu in the Layout Editor.

Department of Mechanical Engineering, LSUSession VII Blank GUI…. The blank GUI template displayed in the Layout Editor is shown in the following figure.

Department of Mechanical Engineering, LSUSession VII UI control objects…. Push Buttons Toggle Buttons Check Boxes Radio Buttons Edit Text Static Text Sliders Frames List Boxes Popup Menus

Department of Mechanical Engineering, LSUSession VII Push Buttons….. Push buttons generate an action when pressed (e.g., an OK button may close a dialog box and apply settings) When you click down on a push button, it appears depressed; when you release the mouse, the button's appearance returns to its non-depressed state; and its callback executes on the button up event

Department of Mechanical Engineering, LSUSession VII Toggle Buttons…. Toggle buttons generate an action and indicate a binary state (e.g., on or off) The callback routine needs to query the toggle button to determine what state it is in –You can do this with a statement that uses the current callback object's handle (gcbo) get(gcbo,'Value') MATLAB sets the Value property to 1 when depressed and 0 when not depressed

Department of Mechanical Engineering, LSUSession VII Check Boxes….. Generate an action when clicked and indicate their state as checked or not checked Useful when providing the user with a number of independent choices that set a mode The Value property indicates the state of the check box by taking on the value 1 or 0 Value = 1, box is checked. Value = 0, box is not checked.

Department of Mechanical Engineering, LSUSession VII Radio Boxes…. Similar to check boxes, but are intended to be mutually exclusive within a group of related radio buttons (i.e., only one button is in a selected state at any given time) To make radio buttons mutually exclusive within a group, the callback for each radio button must set the Value property to 0 on all other radio buttons in the group

Department of Mechanical Engineering, LSUSession VII Edit Text…. Fields that enable users to enter or modify text strings Use edit text when you want text as input The String property contains the text entered by the user.

Department of Mechanical Engineering, LSUSession VII Static Text…. Displays lines of text Typically used to label other controls, provide directions to the user, or indicate values associated with a slider Users cannot change static text interactively and there is no way to invoke the callback routine associated with it.

Department of Mechanical Engineering, LSUSession VII Sliders… Accept numeric input within a specific range by enabling the user to move a sliding bar The location of the bar indicates a numeric value Can set Current Value, Range, and Step size

Department of Mechanical Engineering, LSUSession VII Boxes that enclose regions of a figure window Can make a user interface easier to understand by visually grouping related controls Have no callback routines associated with them and only uicontrols can appear within frames (axes cannot) Frames…

Department of Mechanical Engineering, LSUSession VII Display a list of items (defined using the String property) and enable users to select one or more items By default, the first item in the list is highlighted when the list box is first displayed If you do not want any item highlighted, then set the Value property to empty, [] List Boxes….

Department of Mechanical Engineering, LSUSession VII List Box Example…..

Department of Mechanical Engineering, LSUSession VII Popup Menus…. Open to display a list of choices (defined using the String property) when users press the arrow When not open, a popup menu displays the current choice, which is determined by the index contained in the Value property The first item in the list has an index of 1 You can query the Value property in the callback routine to determine which choice the user made Can be used in place of Radio Buttons

Department of Mechanical Engineering, LSUSession VII Implementation of GUI…. Use GUIDE to lay out the components interactively Generate two files that save and launch the GUI

Department of Mechanical Engineering, LSUSession VII Example : Creating a GUI…. This example will be done in class.

Department of Mechanical Engineering, LSUSession VII This completes the MATLAB Tutorial. Sessions 1 to 7 covered almost all areas of applications of MATLAB. Specialized areas of MATLAB are using the toolboxes. These are a collection of m-files that are specific to the area of application. Looking back….

Department of Mechanical Engineering, LSUSession VII Thank You