Prof. Muhammad Saeed Mathematical Modeling and Simulation UsingMATLAB Graphic User Interface (GUI)Basics.

Slides:



Advertisements
Similar presentations
S i m u l i n k Prof. Muhammad Saeed Mathematical Modeling and Simulation UsingMATLAB 1.
Advertisements

LabVIEW is a graphical programming development environment for data acquisition and control, data analysis, and data presentation. With LabVIEW you can.
MS EXCEL is a spreadsheet application Excel covers: Calculation Graphic tools Pivot tables Macro programming language called VBA EXCEL is a part of MS.
What is a Dialog box? A Dialog box is a window or “form” that contains other child windows or “controls” that have a specific appearances and pre-defined.
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.
1 How to create GUI's in MatLAB Rigo Dicochea. 2 Introduction Graphical User Interface (GUI) MatLab provides Graphical User Interface Development Environment(GUIDE)
3D Game Programming All in One By Kenneth C. Finney.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
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.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
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.
A SPREADSHEET: is an electronic version of a ledger. consists of a grid with columns and rows. is a computation tool. can accurately compute mathematical.
Course 4: Using AdvancedWell Editor Tools. Log curves are resampled.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Intrinsic Functions Pre-coded Functions Used to improve developer productivity Broad Range of Activities Math calculations Time/Date functions String.
Digital Image Processing Lecture 14: GUI using Matlab
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
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 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 --
Introduction to Engineering Microsoft Excel - 3 Agenda Formulas Excel Function Library.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
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.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Basic WPF Controls Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
Software Project Planning Defining the Project Writing the Software Specification Planning the Development Stages Testing the Software.
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.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room , Chris Hill, Room ,
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.
function varargout = MovieJoiner(varargin) % MOVIEJOINER M-file for MovieJoiner.fig % MOVIEJOINER, by itself, creates a new MOVIEJOINER or raises the.
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.
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Designer Basics.
Graphic User Interfaces (GUI) GUI provides a way to interact friendly with possibly complex programs. There are two types of GUI: - MDI: multiple document.
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.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
Topics Introduction Scene Graphs
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 © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 – Graphical User Interfaces Java Foundations: Introduction to Programming.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
User Interface Components Lecture # 5 From: interface-elements.html.
Nonvisual Arrays by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Creating User Interfaces Chapter 13 CSCI CSCI 1302 – Creating User Interfaces2 Outline Introduction Common Features of Swing GUI Components Buttons.
CS112 Scientific Computation Department of Computer Science Wellesley College Interactive Programs Graphical User Interfaces.
EGR 115 Introduction to Computing for Engineers
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
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.
Project Planning Defining the project Software specification Development stages Software testing.
Lecture (7) Introduction to GUI Eng. Osama Talaat 1.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
PATTERN RECOGNITION LAB 8 TA : Nouf Al-Harbi::
More Matlab Graphics and GUI Graphics subplots some useful commands 3D graphics GUI GUI controls The callback property Other essential properties.
軟體實作與計算實驗 1  SUDOKU  New  Play  Check Lecture 8II SUDOKU PUZZLE.
Graphical User Interfaces I
Graphical User Interface in MATLAB
CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming UTPA – Fall 2012 This set of slides is revised from lecture.
User Interface Components
Chap 7. Building Java Graphical User Interfaces
More on Graphical User Interfaces
Graphical User Interfaces -- Introduction
The University of Texas – Pan American
Visual C# - GUI and controls - 1
Presentation transcript:

Prof. Muhammad Saeed Mathematical Modeling and Simulation UsingMATLAB Graphic User Interface (GUI)Basics

GUI Basics: 1.uicontrols Edit Text Static Text Label Push Button Radio Button Button Group Slider Check Box Panel List Box Pop-up Menu Toggle Button Table Axes Menu Toolbar 2Modeling & Simulations

3 Edit Text function edittext1_Callback(hObject, eventdata, handles) s = get(hObject, 'String'); set(hObject, String, s); % if number, use num2str or str2num n = str2num(get(hObject,'string')); if isnan(n) errordlg(Enter a numeric value',Input Error','modal'); uicontrol(hObject); return end Pushbutton function pushbutton1_Callback(hObject, eventdata, handles) plot( ……… ); …………..; end Modeling & Simulations

4 Radiobutton function radiobutton1_Callback(hObject, eventdata, handles) if (get(hObject,'Value') == get(hObject,'Max')) do something else do nothing end set(handles.radiobutton1,'Value','Max) end Checkbox function checkbox1_Callback(hObject, eventdata, handles) if (get(hObject,'Value') == get(hObject,'Max')) %do something else %do something else end % can be used in a groupbox with other uicontrols Modeling & Simulations

5 Buttongroup function uibuttongroup1_SelectionChangeFcn(hObject,eventdata) switch get(eventdata.NewValue,'Tag) case 'radiobutton1' %code; case 'radiobutton2' %code; case 'togglebutton1 %radiobuttons and togglebuttons in group %code; case 'togglebutton2 %code; otherwise % Code for when there is no match. end Slider function slider1_Callback(hObject, eventdata, handles) val = get(hObject,'Value'); %[0 1] …………. %set it to another interval if required as: min+(max-min)*val; end Modeling & Simulations

6 Panel function uipanel1_ResizeFcn(hObject, eventdata, handles) set(hObject,'Units','Points) % Was normalized panelSizePts = get(hObject,'Position'); % Now in points panelHeight = panelSizePts(4); set(hObject,'Units','normalized'); % Now normalized again % Keep fontsize in constant ratio to height of panel newFontSize = 10 * panelHeight / 115; % Calculated in points buttons = get(hObject,'Children'); set(buttons(1),'FontSize,newFontSize);% Resize the first button % Do not resize the other button for comparison end Listbox function listbox1_Callback(hObject, eventdata, handles) index = get(hObject,'Value'); list = get(hObject,'String'); item = list{index}; set(handles.listbox1,'Value',2) end Modeling & Simulations

7 Popupmenu % Using value function popupmenu1_Callback(hObject, eventdata, handles) val = get(hObject,'Value'); switch val case 1 % code case 2 %code end % Using String function popupmenu1_Callback(hObject, eventdata, handles) val = get(hObject,'Value'); list = get(hObject,'String'); str = list{val}; % Convert from cell array to string end Modeling & Simulations

8 Problem I Plancks Radiation Law is formulated as: where R is the spectral radiance and T is temperature in Kelvins and is wavelength of radiation 1) Simulate the Law by plotting R vs for different values of T. range = 0.01m to 8m T range = 500K to 2500K and let user change the temperature T 2) Display temperature at each step. 3) Display maximum Spectral Radiance R at each step 4) Display wavelength at at each R 5) Draw a vertical line between R and corresponding wavelength at each step.

9Modeling & Simulations Problem II T( C) x The above table gives the viscosity ( ) of air at different temperatures (T) Viscosity is expresed as: C and S are constants Determine C and S by curve-fitting using the above equation. Plot a graph between T and for given data (only markers) and plot a line graph using the equation. Calculate the error.

10 END Modeling & Simulations