2D Plots 1 ENGR 1181 MATLAB 12.

Slides:



Advertisements
Similar presentations
Lab # 03- SS Basic Graphic Commands. Lab Objectives: To understand M-files principle. To plot multiple plots on a single graph. To use different parameters.
Advertisements

Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Plotting Selim Aksoy Bilkent University Department of Computer Engineering
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.
Lecture (4) Plotting & Programming (1) Eng. Osama Talaat 1.
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 MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
Digital Image Processing Lecture11: Histogram Processing.
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.
MA/CS375 Fall MA/CS 375 Fall 2002 Lecture 4.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/27/2003.
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
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.
Lecture 9 Plotting in 2-D Plotting in 2-D, Plotting Multiple Curves, Plotting with Figures, Plot Settings, Scaling, Legends © 2007 Daniel Valentine. All.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 11 Charts and Graphs  Read Bishop, Chapter 7.  Lab #11 and Homework #11 due next week.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
MATLAB Fundamentals.
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.
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()
„  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.
Graphing Guidelines  Often the goal of an experiment is to find the relationship between two variables.  As one variable changes, so does the other.
For Loops 1 ENGR 1181 MATLAB 8. For Loops and Looped Programming in Real Life Looping within programs has long been a useful tool for completing mundane.
ENGR 1320 Final Review - Programming Major Topics: – Functions and Scripts – Vector and Matrix Operations in Matlab Dot product Cross product – Plotting.
COMP 116: Introduction to Scientific Programming Lecture 5: Plotting, Scripts and publishing.
MAE 1202: AEROSPACE PRACTICUM An Introduction to MATLAB: Part 2 Mechanical and Aerospace Engineering Department Florida Institute of Technology Developed.
Plot Using Excel. Select Data Insert →Charts →Scatter.
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Statistics and Simple Plots. Outline Announcements: –Homework II: due Today. by 5, by Statistics Simple plots.
Barbara/Pratik/Yu. Outline Matlab desktop M-files Variables Arrays Plots.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
EXCEL CHARTS. CHARTS Charts provide a way of presenting and comparing data in graphical format. Embedded charts or chart sheets Embedded charts are objects.
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)
UW CSE 190p Section 7/26, Summer 2012 Dun-Yu Hsiao.
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.
Array Creation ENGR 1181 MATLAB 2. Civil engineers store seismic data in arrays to analyze plate tectonics as well as fault patterns. These sets of data.
1-d Arrays & Plotting.
ELG 3120 Lab 2 TAs Wei Zhang Ozgur Ekici (Section A) (Section B)
Excel Graphing ENGR 1181 Class 5. Why use Excel?  Excel is a powerful spreadsheet program that can be used for: Creating graphical displays of data Performing.
Array Accessing and Strings ENGR 1187 MATLAB 3. Today's Topics  Array Addressing (indexing)  Vector Addressing (indexing)  Matrix Addressing (indexing)
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
Introduction to MATLAB ENGR 1181 MATLAB 1. MATLAB Built-in Math Functions  Pre-defined in MATLAB ready for use exp(x) – exponential (e x ) log(x) – natural.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
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.
Prof. N. P. Jadhav Presented by. Overview of MATLAB environment MATLAB is an interactive, matrix-based system for scientific and engineering numeric computation.
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.
Computer Application in Engineering Design
Course Information Do not rely on color to distinguish curves (due to black-white printout). Use different line styles to distinguish curves (solid, dashed,
Lecture 25: Exploring data
Two-Dimensional Plots
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files) Double click this icon
Plotting Multiple Graphs In The Same Plot
MATLAB How to use (using M-files)
Introduction to MATLAB Plotting LAB 3
Plotting Signals in MATLAB
Designing Effective Graphics Using MATLAB
Presentation transcript:

2D Plots 1 ENGR 1181 MATLAB 12

Plotting in the Real World 2D (x-y) plot polar plot 3D plot Plotting in the Real World Similar to graphing in Excel, we can generate plots in MATLAB to graphically display information. MATLAB has a variety of plot types available, though we will focus on 2D X-Y plots. Proper formatting allows for information to be clearly conveyed to the audience.

Today's Learning Objectives After today’s class, students will be able to: Create scatter plots in MATLAB with good graphing conventions (e.g., legend, line styles, title, multiple plots on same graph).

Function: plot() Ex: >> plot(x_vec, y_vec) Will generate a line where x_vec is the vector of x values and y_vec is the vector of corresponding y values

Plot Example Let's create two vectors and plot them! Distance = [ 2 6.5 7 7 5.5 4 6 8 ]; Intensity1 = [ 1 2 3 5 7 7.5 8 10 ]; Intensity2= [2 4 5 6 7 8 9 10]; >> plot(Intensity1, Distance)

Plot Example 1 Vectors MUST be same length! MATLAB defaults to blue lines without markers Title, legend, axis labels, etc. are not included unless you give those commands

Line Specifiers Allow you to change the type of line and markers on the plot Refer to your book, or type: help plot for syntax and options Line Style Specifier Line Color Marker Type Solid Dotted Dashed Dash-dot - : -- -. Red Green Blue Black r g b k X-mark Circle Asterisk Point x o * .

Plot Example 2 Let's change our plot! dashed lines red lines asterisk markers >> plot(Intensity1, Distance, '-- r *')

Multiple Curves on Same Plot Multiple sets of data can be plotted together: >> plot(x1,y1,'specifiers',x2,y2,'specifiers') Let's change our plot to include both sets of intensity data: >> plot(Intensity1, Distance,'-- r *', Intensity2,Distance, ': g')

Plot Example 1st set of data has red dashed lines with asterisk markers 2nd set of data has green dotted lines …still no labels or title 

Plot Formatting Title: title('Distance vs. Intensity') Axis Labels: xlabel('Intensity , w/m^2') ylabel('Distance, m') Legend: legend('Data Set 1', 'Data Set 2’)

Plot Example Now it is nicely labeled with good graphing practices! The legend: it's in the way! Change the location: >> help legend legend('Data Set 1', 'Data Set 2', 'Location', 'SouthEast')

Plot Example Much better!! Plot is properly formatted with a descriptive title, labelled axes, and a legend that is in a good location

Important Takeaways The vectors of x and y values must be the same length to make a plot. There are many options for line specifiers, which is useful when there are multiple curves on the same plot. All plots must be formatted with a title, labeled axes, and legend if applicable.

Preview of Next Class 2D Plots 2 Plotting with fplot() command Polar plots in MATLAB Multiple plots in the same figure using the subplot() command

What’s Next? Review today’s Quiz #12 Open the in-class activity from the EEIC website and we will go through it together. Then, start working on MAT-12 homework. Prepare for the next class by reading about 2D Plots 2.