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.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Plotting Selim Aksoy Bilkent University Department of Computer Engineering
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.
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.
MATLAB GRAPHICS 2-D.
Chart ArcView_module_11 May 15, 10:40 AM. Outline Two ways of creating charts How charts are created Steps.
Vectors and Plotting Selim Aksoy Bilkent University Department of Computer Engineering
Fall 2006AE6382 Design Computing1 2D Plotting in Matlab Learning Objectives Discover how Matlab can be used to construct 2D plots. Topics Structure of.
MatlABBA. The Colon Operator (1) This is one MatLab’s most important operators 1:10 means the vector – :-7:50 –
Plotting. Basic Plotting Two vectors of x and y values needed. Vectors need to be of the same length, but not necessarily of the same geometry. For example,
Plotting 1.Overview 2.plot in 2D 3.Plot in 3D 4.Other possible charts 5.Engineers: label your plots! 6.Plots & Polynomial.
Matlab intro The Environment
Designing Effective Graphics Using MATLAB The Cain Project in Engineering and Professional Communication ENGINEERING SERIES.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
Chapter 5 Common Functions and their Properties
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 5”
1 Advanced Plotting ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
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,
„  1999 BG Mobasseri1 9/18/2015 June 2 GRAPHICS IN MATLAB- PART I BASIC PLOTTING.
Plotting – 3-Dimensional. 3D Plots versus 2D Plots 3-dimensional plots, in contrast to 2-dimensional ones, has a third axis (often called the z-axis).
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.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
How to Use MATLAB A Brief Introduction. 2 What can MATLAB do? Matrix Operations Symbolic Computations Simulations Programming 2D/3D Visualization.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
MATLAB for Engineers, by Holly Moore. ISBN © 2007 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is.
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.
Designing Effective Graphics Using MATLAB The Cain Project in Engineering and Professional Communication Linda Driskill, Gang Cheng,
Barak Shenhav Early Evolution Course 11 Feb 2001 MATLAB Visualization, Functions & Debugging.
11/20/2015ENGR 111A - Fall MatLab – Palm Chapter 5 Curve Fitting Class 14.1 Palm Chapter:
Plot (x-values, y-values) >> x = linspace (-3, 3, 20); >> x = linspace (-3, 3, 20); >> y = 2*x – 1; >> y = 2*x – 1; >> plot (x, y) >> plot (x, y)
MATLAB 程式設計 Learning Arrays and x-y Plotting 方煒 台大生機系.
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,
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
Sept. 26, 2005 Lecture 6 - By Paul Lin 1 CPET 190 Lecture 6 Problem Solving with MATLAB
EGR 115 Introduction to Computing for Engineers 2D Plotting – Part I Wednesday 17 Sept 2014 EGR 115 Introduction to Computing for Engineers.
ENG 1181 College of Engineering Engineering Education Innovation Center MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
ECE 351 M ATLAB I NTRODUCTION ( BY T EACHING A SSISTANTS )
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.
Great way to show your data!. * In your journal, draw a 4 square grid.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
CS100A, Fall 1998, Lecture 191 CS100A, Fall 1998 Lecture 19, Thursday Nov 05 Matlab Concepts: Matlab arrays Matlab subscripting Matlab plotting.
CS100A, Fall 1998, Lecture 201 CS100A, Fall 1998 Lecture 20, Tuesday Nov 10 More Matlab Concepts: plotting (cont.) 2-D arrays Control structures: while,
NoViC, Dept. of Mechanical Eng Acoustics Lab., NoViC 1. Download Matlab 2.
Plotting. 2 Initializing Vectors colon operator x = 1:2:10 x = y = 0:0.1:0.5 y =
Outline What is MATLAB MATLAB desktop Variables, Vectors and Matrices Matrix operations Array operations Built-in functions: Scalar, Vector, Matrix Data.
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.
Lecture 17 More Plotting Chapter 12 Matrices. Outline from Chapter D Plotting 11.4 Surface Plots 11.5 Interacting with Plotted Data.
Session III Plotting in MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU MATLAB Tutorials.
Plotting ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne.
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.
Plotting Chapter 5.
Lecture 25: Exploring data
Matrices and Arrays.
Lecture 10 2D plotting & curve fitting
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.
Introduction to MATLAB Programming
Plotting Signals in MATLAB
Designing Effective Graphics Using MATLAB
Announcements P3 due today
How to Use MATLAB A Brief Introduction.
Presentation transcript:

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 and upper limits for x are given as a row vector with two values, as the second argument of the function. Example: fplot('x.*sin(x)', [0 10*pi])

FPLOT example Example of fplot: fplot('x.*sin(x)', [0 10*pi])

Logarithmic plotting Many functions tend to increase exponentially after some point. This presents problems in viewing the behavior (or see the values) of the function where it is close to zero. To accentuate low values and compress the high ones, the axis where the values get too high are plotted on a logarithmic scale. In MATLAB, we can plot x-axis, y-axis, or both axes on a logarithmic scale.

Chart type: SEMILOGX Example: x= e -t, y= t, 0≤t≤2  t= linspace(0, 2*pi, 200); x= exp(-t); y= t; plot(x,y); grid; t= linspace(0, 2*pi, 200); x= exp(-t); y= t; semilogx(x,y); grid;

Chart type: SEMILOGY Example: y= e -x 2, -3 ≤ x ≤ 3 x= linspace(-3, 3, 101); y= exp(-x.^2); plot(x,y); grid; x= linspace(-3, 3, 101); y= exp(-x.^2); semilogy(x,y); grid;

Chart type: LOGLOG Example: x= e -t, y= e 2t, 0 ≤ t ≤ 2  t= linspace(0, 2*pi, 200); x= exp(-t); y= 100+exp(2*t); plot(x,y); grid; t= linspace(0, 2*pi, 200); x= exp(-t); y= 100+exp(2*t); loglog(x,y); grid;

Chart type: POLAR Plots a radial function around 360° Example: r 2 = 2 sin 5t, 0 ≤ t ≤ 2  t= linspace(0, 2*pi, 200); r= sqrt(abs(2*sin(5*t))); polar(t,r);

Chart type: FILL Example: r 2 = 2 sin 5t, 0 ≤ t ≤ 2  x= r cos t, y= r sin t t= linspace(0, 2*pi, 200); r= sqrt(abs(2*sin(5*t))); x= r.*cos(t); y= r.*sin(t); fill(x,y,'r'); axis('square');

Chart type: BAR Example: r 2 = 2 sin 5t, 0 ≤ t ≤ 2  y= r sin t t= linspace(0, 2*pi, 200); r= sqrt(abs(2*sin(5*t))); y= r.*sin(t); bar(t,y); axis([0 pi 0 inf]);

Chart type: BARH Example: World population by continents cont= char('Asia', 'Europe', 'Africa', 'N.America', 'S.America'); pop=[3332; 696; 694; 437; 307]; barh(pop); for i=1:5 gtext(cont(i,:)); end xlabel('Population in millions'); title('World population 1992');

Chart type: PIE Example: World population by continents cont= char('Asia', 'Europe', 'Africa', 'N.America', 'S.America'); pop=[3332; 696; 694; 437; 307]; pie(pop); for i=1:5 gtext(cont(i,:)); end title('World population 1992');

Chart type: COMET Animated linear plot. Example: b= a sin a, 0 ≤ a ≤ 10  a= linspace(0, 10*pi, 2000); b= a.*sin(a); pause(2); comet(a, b);

Multiple charts in a window Multiple plots may be placed in a window using the SUBPLOT command. Syntax: subplot(rows, columns, active) Any plotting command acts on the active subplot only. Active plot is selected in row-major order

Multiple charts in a window Example: x= linspace(0, 4*pi, 100); subplot(3,2,1); plot(x, sin(x)); subplot(3,2,2); plot(2*x, sin(2*x)); subplot(3,2,3); plot(x, cos(x)); subplot(3,2,4); plot(2*x, cos(2*x)); subplot(3,2,5); plot(x, tan(x)); subplot(3,2,6); plot(2*x, tan(2*x));