MATLAB and SimulinkLecture 51 To days Outline Linear Equations ODE Integration Handle Graphics. Exercises on this days topics.

Slides:



Advertisements
Similar presentations
Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
Advertisements

Step-by-Step: Adjust a Chart Axis USE the Pricing Final presentation that is still open from the previous exercise. 1.Click the chart on slide 2 to select.
Graphics Shapes. Setup for using graphics You have to import the graphics library You can use either “import graphics” or “from graphics import *” or.
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Motivation The interactive tools: Drawing commands Interactive figure manipulation The programmer point of view: Introduction to objects and their handles.
Creating Tables Text Tables -created by using preformatted tags. Graphical Tables - created using Table Structure with HTML.
Notes Microsoft PowerPoint. A complete presentations graphic program that allows you to make professional looking presentations Also called a slide show.
Tutorial 4: Designing a Web Page with Tables
Using CSS for Page Layout. Types of HTML Elements Block-Level Element –Creates blocks of content e.g. div, h1..h6, p, ul, ol, li, table, form –They start.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
Working with Vector Graphics – Lesson 21 Working with Vector Graphics Lesson 2.
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
Using HTML Tables.
MORE Cascading Style Sheets (The Positioning Model)
HossamTalaat - MATLAB Course - KSU - 21/1/24 1 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink By Prof. Hossam Talaat.
CSS to Know And this is just the beginning. What to What?  Tags = regular HTML  Ids = #id, only one hashtag per page  Class =.class, many as you want.
XP Tutorial 7 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Working with Graphics Tutorial 7.
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.
Tutorial 4: Using CSS for Page Layout. 2 Objectives Session 4.1 Explore CSS layout Compare types of floating layouts Examine code for CSS layouts View.
AutoCAD Basics The AutoCAD Interface Draw Tool Palette Pull-down Menus
PLOTS AND FIGURES DAVID COOPER SUMMER Plots One of the primary uses for MATLAB is to be able to create publication quality figures from you data.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Tutorial 4 Creating Special Effects with CSS
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
A short intermission about function handles and cell arrays A MATLAB function may be referenced by a handle. >> sphere(100)
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
Ranjeet Department of Physics & Astrophysics University of Delhi Working with Origin.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
CHAPTER 10 Formatting Tables and Forms. Using Tables the Right Way  HTML and XHTML have a LOT of tags dedicated to building a table  If you have only.
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.
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 ,
Introduction to Java Simple Graphics. Objects and Methods Recall that a method is an action which can be performed by an object. –The action takes place.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 9”
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
Figures & Axes, Printing & Saving. Outline Announcements –Homework I due Wed. 5PM by –No lecture on Fri. 10/26, rescheduled to Wed. 10/31 at 8AM.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
External Executable Tools The Master's Touch David L. Blankenship.
Presented By: Weidong WU, Ph.D. Date: Part I Creating a drawing format for the paper size A (11 x 8.5) 1. Start Pro/E wildfire. 2. File  set.
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
Solving Systems of Linear Equations Wait a minute! What’s a system of linear equations? –A system is a set of linear sentences which together describe.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
Handle Graphics and 1D Primitives Some Handel graphics.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Word 2010 © 2011 The McGraw-Hill Companies,
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
Figures & Axes, Printing & Saving. Outline Announcements –Homework I on web, due Wed. 5PM by –No lecture on Fri. 10/26, rescheduled to Wed. 10/31.
More Matlab Graphics and GUI Graphics subplots some useful commands 3D graphics GUI GUI controls The callback property Other essential properties.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 6 1 Creating Dynamic Pages.
Graphics Intro UC Berkeley Fall 2007, E7 Copyright , Andy Packard and Roberto Horowitz. This work is licensed under the Creative Commons Attribution-ShareAlike.
Beginning Programming for Engineers Animation. Special matrix functions >> clear >> ones(2,3) >> zeros(3,5) >> ones(2) >> zeros(3) >> eye(4) >> magic(4)
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
Figures & Axes, Printing & Saving. Outline Announcements –Homework I on web, due Wed. 5PM by e- mail A word on HWI and cookies What happens when you plot.
EGR 106 – Week 5 – 2-D Plots Question : Why do engineers use plots? Answer : To analyze, visualize, and present data. Matlab has many useful plotting options.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Tutorial 4 Using CSS for Page Layout. Objectives Session 4.1 – Explore CSS layout – Compare types of floating layouts – Examine code for CSS layouts –
Reading and Writing Image Files
Inserting and Working with Images
MORE Cascading Style Sheets (The Positioning Model)
DREAMWEAVER MX 2004 Chapter 7 Working with Layers
Tutorial 2 SEG7550 Introduction to MATLAB II
Plotting Signals in MATLAB
Topics Graphical User Interfaces Using the tkinter Module
Cascading Style Sheets
Presentation transcript:

MATLAB and SimulinkLecture 51 To days Outline Linear Equations ODE Integration Handle Graphics. Exercises on this days topics

MATLAB and SimulinkLecture 52 Linear Equations Linear equations Using left division MATLAB uses Gaussian elemination Has the solution in MATLAB X=A\Y Example: Solve the system of linear equation:

MATLAB and SimulinkLecture 53 ODE MATLAB can solve system of first order ordinary differential equations with known initial condition. MATLAB offers a number of different solvers ode45 This is the typical first solver to try on a new problem. ode15s This is typical to try if ode45 fails or are too inefficient. Solves stiff problems. Stiff problem are described as problem in which the time constants vary a lot.

MATLAB and SimulinkLecture 54 ODE General form [time,x]=solver(fh,t,x0) time: Time values x: contains the solution for each time value solver: one of MATLAB’s ode solvers fh: A function handle to the function that describes the differential equations t: is the time span T0 to TFINAL x0: Initial condition

MATLAB and SimulinkLecture 55 ODE Example: Solve the differential equation:

MATLAB and SimulinkLecture 56 ODE

MATLAB and SimulinkLecture 57 ODE Higher order differential equations must be rewritten into system of first order differential equations. m k b y F

MATLAB and SimulinkLecture 58 Integration Trapezoidal numerical integration. z = trapz(x,y) computes the integral of y with respect to x using the trapezoidal method. The trapezoidal technique is used when we only know the integrand in a number of specific points. With a smaller delta-x the numerical integration becomes more accurate

MATLAB and SimulinkLecture 59 Handle Graphics A set of low level functions that control the characteristic of a graphic object. Changing grids, line color etc. that is not supported by the standard LinSpec option in the plot command. MATLAB graphics system is based on a hierarchical system of Graphical Objects

MATLAB and SimulinkLecture 510 Handle Graphics Each graphical object are known by a unique name: Handle Each graphical object has special data: properties A handle is automatically returned by any command that creates a graphic object. Hndl=figure

MATLAB and SimulinkLecture 511 Handle Graphics

MATLAB and SimulinkLecture 512 Handle Graphics When an object is created all of its properties are initialized to default values. plot(y) uses the default line color, line style, line width etc. All properties can be examined using: get(Handle,’PropertyName’); All properties can be changed using: set(Handle,’PropertyName’,Value1’,….); If value are left out MATLAB display a list of possible property values for that actual property name

MATLAB and SimulinkLecture 513 Handle Graphics To view all properties: x=[0:0.1:2]; y=x.^2; Hndl=plot(x,y)%Handle to the line. result=get(Hndl) result will be a structure containing all properties to the line

MATLAB and SimulinkLecture 514 Handle Graphics BeingDeleted: 'off' BusyAction: 'queue' ButtonDownFcn: '' Children: [0x1 double] Clipping: 'on' Color: [0 0 1] CreateFcn: '' DeleteFcn: '' EraseMode: 'normal' HandleVisibility: 'on' HitTest: 'on' Interruptible: 'on' LineStyle: '-' LineWidth: Marker: 'none' MarkerEdgeColor: 'auto' MarkerFaceColor: 'none' MarkerSize: 6 Parent: Selected: 'off' SelectionHighlight: 'on' Tag: '' Type: 'line' UIContextMenu: [] UserData: [] Visible: 'on' XData: [1x53 double] YData: [1x53 double] ZData: [1x0 double]

MATLAB and SimulinkLecture 515 Handle Graphics To change the line width from default 0.5 to 5: set(Hndl,’LineWidth’,5)

MATLAB and SimulinkLecture 516 Handle Graphics Functions that return handles gcf Get current figure. gca Get current axes in the current figure. gco Get current object in the current figure. findobj Finds a graphics object with a specific property value The current object is defined as the last object clicked on with the mouse.

MATLAB and SimulinkLecture 517 Handle Graphics Position of figure Objects [left bottom width height] Units can be: pixels, inches, cm, points and normalized coordinates. Normalized coordinates are between 0-1. (0,0) = Lower left corner (1,1) = Upper right corner Using normalized coordinates will make the figure to appear in the same relative position regardless of screen resolution. Normalized coordinates are recommended to use if possible

MATLAB and SimulinkLecture 518 Handle Graphics Position of axes and uicontrol Objects Also a 4-element vector. [left bottom width height] Position is specified relative to the figure that contains the object. Default units: Normalized coordinates within the figure.

MATLAB and SimulinkLecture 519 Handle Graphics Position of text Objects The position of a text object refers to the actual axes. x,y in 2D x,y,z in 3D The position of the text object relative to a specified point is controlled by: HorizontalAlignment {Left},Center,Right VerticalAlignment {Middle}, Top, Cap, Baseline, Bottom

MATLAB and SimulinkLecture 520 Handle Graphics Example: -Construct a dartboard with 10 circles. -Add text in each circle what the point would be if the dart should hit within that circle. -Construct a frame around the dartboard. -Simulate that a person throw 10 darts at the board with the standard deviation 4 in x and y direction.

MATLAB and SimulinkLecture 521

MATLAB and SimulinkLecture 522 Exercises on this days topics