1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.

Slides:



Advertisements
Similar presentations
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Advertisements

Plotting Selim Aksoy Bilkent University Department of Computer Engineering
Introduction to Matlab
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.
1 Chapter 4 Curve Plotting with MATLAB MATLAB provides some very powerful features for plotting and labeling curves. These operations can be performed.
MATLAB - Basics Centro de Informática Universidade Federal de Pernambuco Aprendizagem de Máquina – IN1102 Arley Ristar –
Slide deck by Dr. Greg Reese Miami University MATLAB An Introduction With Applications, 5 th Edition Dr. Amos Gilat The Ohio State University Chapter 3.
Creating a Histogram using the Histogram Function.
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.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
MATLAB Fundamentals.
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.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
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.
REVIEW 2 Exam History of Computers 1. CPU stands for _______________________. a. Counter productive units b. Central processing unit c. Copper.
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.
A Brief Introduction to Matlab Laila Guessous Dept. of Mechanical Engineering Oakland University.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
Eng Ship Structures 1 Introduction to Matlab.
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
Introduction to Matlab Module #2 Page 1 Introduction to Matlab Module #2 – Arrays Topics 1.Numeric arrays (creation, addressing, sizes) 2.Element-by-Element.
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.
Scientific Computing Introduction to Matlab Programming.
ES 240: Scientific and Engineering Computation. Chapter 2 Chapter 2: MATLAB Fundamentals Uchechukwu Ofoegbu Temple University.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
Master in Optical Fiber Communications and Photonic Technologies Foundations of Digital Transmission - Fall quarter Introduction to Matlab.
1 DKT 211 Basic Communication Engineering LAB # 1A : (Lecture 1) Introduction to Matlab  Basic Features  Scientific features  Array Operations  Script.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Part 1 Chapter 2 MATLAB Fundamentals PowerPoints organized by Dr. Michael R. Gustafson II, Duke University and Prof. Steve Chapra, Tufts University All.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
Recap Plots with More than one Line Plots of Complex Arrays Line, Color and Mark Style Axis Scaling and Annotating Plots Subplots Polar Plots Logarithmic.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
Introduction to Matlab
ENG 1181 College of Engineering Engineering Education Innovation Center MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various.
INTRODUCTION TO MATLAB Dr. Hugh Blanton ENTC 4347.
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Program design and algorithm development We will consider the design of your own toolbox to be included among the toolboxes already available with your.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
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 7.1 The Leaning Tower of.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
1 Lecture 8 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
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::
Matlab Class 8 Xiaotao Su, Ph.D. Visual Psychophysicist & IT Group Leader Rutgers Center for Cognitive Science (RuCCS) and Chris Kourtev.
EEE 242 Computer Tools for Electrical Engineering
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.
Session III Plotting in MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU MATLAB Tutorials.
Computer Application in Engineering Design
Lecture 25.
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
Tutorial 2 SEG7550 Introduction to MATLAB II
Plotting Multiple Graphs In The Same Plot
Introduction to MATLAB Programming
Introduction to Matlab
Plotting Signals in MATLAB
Histograms are plots that show the distribution of data.
Presentation transcript:

1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.

Assignment Write a function called int_col that has one input argument, a positive integer n that is greater than 1, and one output argument v that is a column vector of length n containing all the positive integers smaller than or equal to n, arranged in such a way that no element of the vector equals its own index. In other words, v(k) is not equal to k for any valid index k. 2

In the previous lectures 3  Matlab Windows (workspace, m-file,…)  Working with Arrays  Mathematical Operations with Arrays  Generating Random numbers  Using Script Files and Managing Data

Agenda 4  Plotting given data and functions.  Plotting multiple graphs in the same plot.  Formatting a plot.  Special plots: error bars, pie, histogram.  Plotting multiple plots in the same page.

Powerful Tool 5  Standard plots with linear axis.  Plots with logarithmic, semi-logarithmic axis, bar, stairs plots, three-dimensional contour surface and others.  You can control the line type (solid, dash,…), color, thickness, grid lines and text comments.  Several plots can be placed in the same page.  A legend can be added…

6 Terminology

7  The two vectors have the same number of elements. The plot Command

8 Continuous line

9 The plot Command optional arguments

10 The plot Command optional arguments

11 The plot Command optional arguments

12  You can also control: The plot Command optional arguments

13  Example: Plotting given data

14  Example: Plotting given data

15  To plot a function y=f(x), you have first to create a vector of values for x, then the vector of y is calculated element by element. Plotting a function

16 Plotting a function Notice the small spacing between x values: 0.01.

17 The fplot command

18  Using Plot : Example: Plotting multiple graphs in the same Plot

19  Using Plot : Example: Plotting multiple graphs in the same Plot

20  Using hold on / hold off commands: Example: Plotting multiple graphs in the same Plot

21  Using hold on / hold off commands: Example: Plotting multiple graphs in the same Plot

22  Using hold on / hold off commands: Example modification Plotting multiple graphs in the same Plot New figure Without figure, hold off will erase the previous plots and keep only next plot.

23  Using hold on / hold off commands: Example modification Plotting multiple graphs in the same Plot

24 Formatting a plot

25 Formatting a plot

26 Formatting a plot

27  Example: Formatting a plot

28  Example: Formatting a plot

29 Plots with error bars

30 Plots with special graphs

31 Plots with special graphs

32  Histograms are plots that show the distribution of data.  The overall range of a given set of data points is divided into subranges (bins).  The histogram shows how many data points are in each bin.  The histogram is a vertical bar plot in which the width of each bar is equal to the range of the corresponding bin and the height Histogram

33 Histogram

34  You can change the number of bins: Histogram

35  You can change the number of bins: Example: Histogram

36  subplot command:  The command divides the Figure Window (and the page when printed) into mxn rectangular subplots.  The subplots are numbered from 1 to ( mxn ), the current plot is p. Putting multiple plots in the same page

37  subplot command: Example: Putting multiple plots in the same page

Material & problems 38  We have covered Chapter 5 from Gilat.  Problems you can try: Sample Problem 5-2 1—5, 11, 18, 19, 31