1-d Arrays & Plotting.

Slides:



Advertisements
Similar presentations
Start with your equation Move the # term to the other side, and leave a space Determine what HALF of the coefficient of X is Factor the left side Write.
Advertisements

Lecture 5.
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Introduction to Matlab
Empirical Model Building I: Objectives: By the end of this class you should be able to: find the equation of the “best fit” line for a linear model explain.
2D Plots 1 ENGR 1181 MATLAB 12.
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
1 Chapter 4 Curve Plotting with MATLAB MATLAB provides some very powerful features for plotting and labeling curves. These operations can be performed.
Matrix Manipulation and 2D Plotting
SOLVING QUADRATICS General Form: Where a, b and c are constants.
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
First-Year Engineering Program 1 Autumn 2009 Graphing with Microsoft Excel Lecture 11 Engineering H191 Engineering Fundamentals and Laboratory.
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
Exam #3 Review: Comprehensive Exam Class 14.2 Palm Matlab Book Ch. 1-5.
Solving Polynomial Equations
Introduction to Excel 2007 Part 1: Basics and Descriptive Statistics Psych 209.
Solving Quadratic Equations Tammy Wallace Varina High.
Use intercepts to graph an equation
Introduction to Matlab Jianguo Wang CSSCR September 2009.
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Introduction  Today we are looking at how to interpret experimental data  Normally, data is acquired with random errors  How do we take the data and.
MATLAB Fundamentals.
259 Lecture 15 Introduction to MATLAB. 2 What is MATLAB?  MATLAB, which stands for “MATrix LABoratory” is a high- performance language for technical.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
Plotting II: By the end of this class you should be able to: Create a properly formatted engineering graph Create graphs of a function Place multiple plots.
Descriptive Statistics I: By the end of this class you should be able to: Palm: Section 7.1, 7.2 Program cords and delays in your music programs plot a.
INTRODUCTION TO MATLAB LAB# 01
COMP 116: Introduction to Scientific Programming Lecture 5: Plotting, Scripts and publishing.
Objectives Identify the multiplicity of roots Use the Rational Root Theorem and the Irrational Root Theorem to solve polynomial equations.
Getting Started with TI-Interactive. TI-Interactive TI-Interactive can be used to create a variety of graphs. Scatter Plots, Line Plots, Histograms, Modified.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
MATLAB Jirawat Kanjanapitak (Tae). What is MATLAB A computer program for doing numerical computation including; Arithmetic, Polynomials, Graphics, 2-D.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
UW CSE 190p Section 7/26, Summer 2012 Dun-Yu Hsiao.
GRAPHICS MODULE 14 STUDY BOOK. Graphic commands SCREEN - puts the screen into graphics mode WINDOW - allows scaling of the screen LINE - 3 formats –LINE.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
Warm Up Write as an inequality and interval notation.
Files: By the end of this class you should be able to: Prepare for EXAM 1. create an ASCII file describe the nature of an ASCII text Use and describe string.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
MATLAB Jirawat Kanjanapitak (Tae). What is MATLAB A computer program for doing numerical computation including; Arithmetic, Polynomials, Graphics, 2-D.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
“Moh’d Sami” AshhabSummer 2008University of Jordan MATLAB By (Mohammed Sami) Ashhab University of Jordan Summer 2008.
To add, subtract, multiply, and divide, absolutely follow the mathematical rules. 1. All the rules 2. The element-per-element operator 3. Ex1: graphing.
Exponential and Logarithmic Equations What you ‘ll learn To solve exponential and logarithmic equations Vocabulary Exponential equation, Logarithmic equation.
Example 1 Solve Using Equal Powers Property Solve the equation. a. 4 9x = – 4 x x23x = b. Write original equation. SOLUTION a. 4 9x 5 42.
End Behavior.
Computer Application in Engineering Design
Review Problems Matrices
Lecture 25.
ECE 1304 Introduction to Electrical and Computer Engineering
Solution of Nonlinear Equations
9.6 Perfect Squares & Factoring
Introduction to Matlab
(Mohammed Sami) Ashhab
Tables and Relations Review
MATLAB – What Is It ? Name is from matrix laboratory Powerful tool for
Tables and Relations Review
Plotting Multiple Graphs In The Same Plot
Systems of Linear and Quadratic Equations
Common Core Algebra Review
y x y = x + 2 y = x + 4 y = x – 1 y = -x – 3 y = 2x y = ½x y = 3x + 1
Tables and Relations Review
Tables and Relations Review
Drawing Graphs The straight line Example
Print out these axes and put in plastic wallets
Presentation transcript:

1-d Arrays & Plotting

Creating Arrays Problem: Give 3 different MATLAB commands to create the array shown below x = [ 2 2.2 2.4 2.6 2.8 3.0 3.2] Answers: >> x = [ 2 2.2 2.4 2.6 2.8 3.0 3.2] >> x = 2:0.2:3.2 >> x = linspace(2, 3.2, 7)

Creating Arrays Why can’t the array shown below be created using a single linspace or start:inc:max command? x = [ 2 2.2 2.4 2.6 3.0 3.2] Answer: Need equal spacing between the values. However, you can concatenate vectors: >> x = [ 2:0.2:2.6 3 3.2] >> x = [ linspace(2,2.6,4) 3 3.2]

Plotting Plot the following polynomial in MATLAB: What are the steps? Create a t-vector of values Calculate the y-values (remember arithmetic operators and entry by entry operators) Use >> plot(t,y)

Demo Plot Tools All plots should be labeled and titled. This can be done at the MATLAB command line using xlabel, ylabel, and title. Plots can also be formatted using commands within the plot statement. Plot tools provides an alternative option for labeling, formatting, adjusting range, adding text boxes, ....

Solving Equations Graphically Consider the same polynomial. Use the data cursor to find the roots of the polynomial. How many roots should there be? Do we need to change our plot?

Graphs on Same Plot Graph both of these decaying exponentials on the same plot and add a legend. This can be done in a single plot statement. What is a good range for t? (Hint: e-5 is very small)

Subplot Command Graph these two functions in separate sub-windows using the subplot command.