ENG 1181 College of Engineering Engineering Education Innovation Center MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various.

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
Lecture (4) Plotting & Programming (1) Eng. Osama Talaat 1.
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
ELECTRONIC SPREADSHEATS ELECTRONIC SPREADSHEATS Chapter 14 Dr. Bahaa Al-Sheikh & Eng. Mohammed AlSumady Intoduction to Engineering BME152.
MATLAB - Basics Centro de Informática Universidade Federal de Pernambuco Aprendizagem de Máquina – IN1102 Arley Ristar –
Introduction to Engineering MATLAB – 10 Plotting - 3 Agenda Special 2-D Plots fplot command.
Slide deck by Dr. Greg Reese Miami University MATLAB An Introduction With Applications, 5 th Edition Dr. Amos Gilat The Ohio State University Chapter 5.
B a c kn e x t h o m e Frequency Distributions frequency distribution A frequency distribution is a table used to organize data. The left column (called.
CITS2401 Computer Analysis & Visualisation
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
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 Excel 2007 Part 3: Bar Graphs and Histograms Psych 209.
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.
Describing Data with Tables and Graphs.  A frequency distribution is a collection of observations produced by sorting observations into classes and showing.
Graphing Examples Categorical Variables
Graphing A Practical Art. Graphing Examples Categorical Variables.
Exploratory Data Analysis. Computing Science, University of Aberdeen2 Introduction Applying data mining (InfoVis as well) techniques requires gaining.
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.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Graphs in Science You Can Do It!!!.
Graphs Displaying Data. Graphing Graphs are visual displays of data. Different types of graphs are used for different purposes. The correct type of graph.
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.
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.
Graphs Graphs are used to display data. They visually represent relationships between data. All graphs should have a title that identifies the variables.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB is a powerful program for numerical computations, plotting and programming.
Chapter 2 Frequency Distributions
Chapter 13 The Math for Graphing in DC Circuits. Graphing Overview  Critical for practical analysis many different natural systems. Note: Theoretical.
MATLAB for Engineers, by Holly Moore. ISBN © 2007 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is.
EXPLORING DATA LESSON 1 – 1 Day 2 Displaying Distributions with Graphs Displaying quantitative variables.
Graphing Exercise. In this exercise you are going to make as many dots as you can on your whiteboard in a chosen amount of time. You will then graph your.
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.
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.
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,
5.7 Use Figures in Three – Dimensional Space Pg.205.
ENG College of Engineering Engineering Education Innovation Center 1 Basic For Loops in MATLAB Programming in MATLAB / Chapter 6 Topics Covered:
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Complete Graph. What is wrong with the Graph? The graph needs to have numeric labels on the axes. We can not determine a coordinate without them. Does.
Program design and algorithm development We will consider the design of your own toolbox to be included among the toolboxes already available with your.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 2 in MATLAB Topics Covered: 1.More about 2-D plots  Placing multiple.
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.
Chapter 2 Frequency Distributions PowerPoint Lecture Slides Essentials of Statistics for the Behavioral Sciences Seventh Edition by Frederick J Gravetter.
Data Representation: Making Tables & Graphs. Data Tables.
Aim: How do scientist organize their experimental information?
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.
Grouped Frequency Tables
ENG College of Engineering Engineering Education Innovation Center 1 Arrays in MATLAB Topics Covered: 1.Creating arrays of numbers vectors matrices.
Bar Graphs and Line Graphs
Section 3.6 Functions.
Lecture 25: Exploring data
Two-Dimensional Plots
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.
Plotting Data with MATLAB
Histograms are plots that show the distribution of data.
Presentation transcript:

ENG 1181 College of Engineering Engineering Education Innovation Center MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various types of plots. 2D plot polar plot3D plot

ENG 1181 Two Dimensional Plots in MATLAB Topics Covered: Cautions when using different plot functions fplot polar plot histograms subplot

ENG THE fplot COMMAND fplot(‘function’,limits) The fplot command can be used to plot a function with the form: y = f(x)  The ‘function’ line can only contain one variable name, e.g. a=2;b=-1;c=3; fplot(‘ax^2+bx+c’, [-2,2]) will give an error message as a, b, and c will be considered variables  The function fplot produces a smooth plot of a function for a linear plot. Using fplot and then converting one or both axes to log axes will in general not produce a smooth plot, even when the plotted function should be smooth.

ENG 1181 THE polar COMMAND The polar command can be used to plot a function with coordinates r and Ɵ. polar(theta,r)  Theta and r should be equal length arrays, just as with the plot function.  Theta must be in radians.  The order of the variables is the opposite to the normal math order.  Hold on, hold off must be used to place multiple curves on the same graph.  The size of the graph (r coordinate scale) is set by the first curve plotted – so plot the largest curve first

ENG 1181 Histograms The hist command can be used to create a histogram, but produces a graph with connected columns which can look bad when printed in b/w. The graph can be improved by using hist to organize data and then feeding the results to the bar function which produces nicer results, e.g.  Step 1: Given an array y, [n, xout] = hist(y,nbins); will organize the values y into nbins equally spaced bins. The variable n is an array containing the number of occurrences in each bin and xout is an array containing the center location for each bin.  Step 2: bar(xout,n) will create a vertical bar chart of the data. The columns will be separated and look much better in b/w.

ENG THE subplot COMMAND subplot(n,m,locn) The subplot command can be used to organize a number of graphs in the same figure window  Subplot only indicates a location within the figure window to place a graph. The graph should be created following the subplot command. Any valid MATLAB plotting command may be used, e.g. plot, polar, semilogx, fplot, bar, stem, etc.  Not all locations in the array of graphs need to be used.  Within a figure window, the same values of n and m must be used for all subplot commands. Unfortunately subplot cannot be used as a sophisticated page layout tool. For example, you cannot place two figures at the top of a figure window with subplot(2,2,1) and subplot(2,2,2) and then place one figure at the bottom with subplot(2,1,2). Maybe someday this will work …