1 Advanced Plotting ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem

Slides:



Advertisements
Similar presentations
Lecture 5.
Advertisements

CSE 123 Plots in MATLAB. Easiest way to plot Syntax: ezplot(fun) ezplot(fun,[min,max]) ezplot(fun2) ezplot(fun2,[xmin,xmax,ymin,ymax]) ezplot(fun) plots.
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.
Introduction to Engineering MATLAB – 10 Plotting - 3 Agenda Special 2-D Plots fplot command.
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.
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
Vectors and Plotting Selim Aksoy Bilkent University Department of Computer Engineering
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
EGR106 Week 4 Two Dimensional Plots Multiple Plots Plot Formatting Homework.
Introduction to MATLAB for Engineers, Third Edition Chapter 5 Advanced Plotting PowerPoint to accompany Copyright © The McGraw-Hill Companies, Inc.
Introduction to Matlab 332:202 Discrete Mathematics Spring 2007.
Plotting - Advanced. FPLOT Plots a function f(x) written as a string within quotation marks. The free variable needs to be designated with x. The lower.
EPSII 59:006 Spring Outline Managing Your Session File Usage  Saving Workspace  Loading Data Files  Creating M-files More on Matrices Review.
For loop Khairul anwar.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
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.
MATLAB AutoCAD Visio Rational Rose Computer Applications in Engineering Design Introductory Lecture LabVIEW PSPICE Orcad.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5 Advanced.
CMPS 1371 Introduction to Computing for Engineers PLOTTING.
1 "A picture is worth a thousand words." Graphical representation is useful for: Error detection - you can locate outliers in a dataset, program bugs,
MATLAB Plotting With MATLAB 1. Two Dimensional Plots The xy plot is the most commonly used plot by engineers The independent variable is usually called.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
1 Functions ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
Lecture 10 2D plotting & curve fitting Subplots Other 2-D Plots Other 2-D Plots Curve fitting © 2007 Daniel Valentine. All rights reserved. Published by.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5 Advanced.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5 Advanced.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® Chapter 5 Advanced.
Chapter 5 Advanced Plotting and Model Building. Matlab, Maple & Mathematica – plots are part of the package!!! Type help graph2d or graph3d to get help.
1 Programming with MATLAB ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5 Advanced.
Graphing Basics. Creating a graph Draw the y-axis on the vertical axis and the X-axis on the horizontal one Label what variable is on each of the axis.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
2D Plots 2 ENGR 1181 MATLAB 13. Plotting in the Real World 2D plots generated by MATLAB can be used in a variety of fields, including the one shown here,
Chapter 4.1: Scatter Plots. Lesson 4.1: Scatter Plots.
Creating a Scatter Plot On a Mac. Data in Excel Spreadsheet Insert the variable you want on the x-axis in the left column Insert the variable you want.
ELG 3120 Lab 2 TAs Wei Zhang Ozgur Ekici (Section A) (Section B)
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 2 in MATLAB Topics Covered: 1.More about 2-D plots  Placing multiple.
GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Deniz Savas & Mike Griffiths May 2015.
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5 Advanced.
1 Matlab for Engineering Applications Introduced by Jen-Yang Chen Department of Electronic Engineering Ming Chuan University.
 Graphs are the best way to visually represent relationships between two variables.  Y-AXIS (VERTICAL)  for our purposes this will always be distance.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
PATTERN RECOGNITION LAB 2 TA : Nouf Al-Harbi::
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.
Session III Plotting in MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU MATLAB Tutorials.
CHART COMPONENTS Excel. COMPONENTS OF CHARTS AND GRAPHS ▪ The y-axis is the left vertical side of the graph. It contains the numerical data. ▪ The x-axis.
Creating a Plot The plot function can take one or more inputs; e.g. plot (x, y) or plot (y) Note that in the two-argument version, the vectors x and.
Plots and Graphics.
3D-Graphs A 3D surface is defined as: z = f(x, y)
Matrices and Arrays.
Matlab for Engineering Applications
MatLab – Palm Chapter 5 2-D & 3-D Plots
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
Introduction to MATLAB 7
MATLAB How to use (using M-files) Double click this icon
Warmup NO CALCULATORS Convert into radians or degrees.
MATLAB How to use (using M-files) Double click this icon
MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various types of plots. Instructor notes: We start with an example of some.
Plotting Signals in MATLAB
How to Use MATLAB A Brief Introduction.
Introduction to Matlab
Presentation transcript:

1 Advanced Plotting ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem

2 Outline xy plot Grid and Axis fplot polynomial plot subplot

3 Plotting Two-dimensional plot (xy plot) help graph2d Three-dimensional plot (xyz plot, surface plot) help graph3d

4 xy Plotting Functions y = f(x) x-axis (abscissa) y-axis (ordinate) abscissa ordinate

5 The Anatomy of a Plot Plot TitleY-Axis Label X-Axis Label Tick Mark Tick-Mark Label Legend Data Symbol

6 Plot Essential Features Axis label with unit Regular spaced tick mark (0.5, 1.0, 1.5, … ) More than one curve  use Legend Use Title Plot measured data using Data Symbol Careful about connecting line

7 Plotting example y = 0.4 √1.8x for 0 ≤x ≤ 52 y = height of a rocket after launch (miles) x = horizontal (downrange) distance (miles) >>x = [0:0.1:52]; >>y = 0.4*sqrt(1.8*x); >>plot(x,y) >>xlabel(’Distance (miles)’) >>ylabel(’Height (miles)’) >>title(’Rocket Height as a Function of Downrange Distance’)

8 Plotting example

9 Grid and axis Commands grid display gridlines toggle by grid on or grid off axis override MATLAB axis syntax axis([xmin xmax ymin ymax])

10 Plotting example II >>x = [0:0.1:52]; >>y = 0.4*sqrt(1.8*x); >>plot(x,y) >>xlabel(’Distance (miles)’) >>ylabel(’Height (miles)’) >>title(’Rocket Height as a Function of Downrange Distance’) >>grid on >>axis([ ])

11 Plotting example II

12 Plots of Complex Numbers plot(y)  plot(real(y),imag(y)) >>z = i; >>n = [0:0.01:10]; >>plot(z.^n) >>xlabel(‘Real’), ylabel(‘Imaginary’)

13 Plots of Complex Numbers

14 fplot command Automatically analyzes the function Then decides the plotting points Syntax fplot(‘string’,[xmin xmax]) string  describe function [xmin xmax]  value of variable

15 fplot example >>a_func = ‘cos(tax(x))-tan(sin(x))’; >>fplot(a_func,[1 2]) >>xlabel(‘x’),ylabel(‘function’) >>title(‘using fplot’)

16 fplot example I

17 Compare to fplot >>x=[1:0.01:2]; >>y=cos(tax(x))-tan(sin(x)); >>plot(x,y) >>xlabel(‘x’),ylabel(‘function’) >>title(‘using fplot’)

18 Compare to fplot

19 Compare to fplot fplot plot

20 Polynomial Plot >>x=[-6:0.01:6]; >>p=[3,2,-100,2,-7,90]; >>plot(x,polyval(p,x)) >>xlabel(‘x’),ylabel(‘p’) >>title(‘polynomial plot’) p(x) = 3x 5 + 2x 4 – 100x 3 +2x 2 – 7x+90

21 Polynomial Plot

22 Subplots Several smaller plots in one figure Syntax subplot(m,n,p) m  m rows n  n columns p  output plot

23 Subplots example I >> x = [0:0.01:5]; >>y = exp(-1.2*x).*sin(10*x+5); >>subplot(1,2,1) >>plot(x,y),axis([ ]) >>x = [-6:0.01:6]; >>y = abs(x.^3-100); >>subplot(1,2,2) >>plot(x,y),axis([ ]) y = e -1.2x sin(10x + 5) for 0 ≤x ≤ 5 y = |x | for -6 ≤ x ≤ 6.

24 Subplots example I

25 Subplots example II >> x = [0:0.01:5]; >>y = exp(-1.2*x).*sin(10*x+5); >>subplot(2,1,1) >>plot(x,y),axis([ ]) >>title(‘figure(a)’) >>x = [-6:0.01:6]; >>y = abs(x.^3-100); >>subplot(2,2,2) >>plot(x,y),axis([ ]) >>title(‘figure(b)’)

26 Subplots example II