NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.

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.
2D Plots 1 ENGR 1181 MATLAB 12.
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.
Matrix Manipulation and 2D Plotting
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.
MA/CS375 Fall MA/CS 375 Fall 2002 Lecture 4.
FIRST COURSE Excel Tutorial 4 Working with Charts and Graphics.
MATLAB GRAPHICS 2-D.
Lesson 6: basic plots. Lesson 6 Outline: Plot 1-basic plot commands 1) Figure Line style Marker style Labels and Titles Axes Matlab help LineSpec (colors,
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.
Introduction to M ATLAB Basic Graphics
EGR106 Week 4 Two Dimensional Plots Multiple Plots Plot Formatting Homework.
Introduction to Matlab 332:202 Discrete Mathematics Spring 2007.
Lecture 9 Plotting in 2-D Plotting in 2-D, Plotting Multiple Curves, Plotting with Figures, Plot Settings, Scaling, Legends © 2007 Daniel Valentine. All.
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,
Using Charts in a Presentation Lesson 6. Software Orientation Charts can help your audience understand relationships among numerical values. The figure.
How To Make Graphs in Microsoft Excel Outline Making Bar Graphs Making Scatter Plots – 1 series Making Scatter Plots – Multiple Series.
NU Data Excel Orientation Graphing of Screening Data and Basic Graphing Functions.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
Instructor: Professor Cora Martinez, PhD Department of Civil and Environmental Engineering Florida International University.
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()
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.
CHAPTER 9 Introducing Microsoft Office Learning Objectives Start Office programs and explore common elements Use the Ribbon Work with files Use.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
COMP 116: Introduction to Scientific Programming Lecture 5: Plotting, Scripts and publishing.
Getting Started with TI-Interactive. TI-Interactive TI-Interactive can be used to create a variety of graphs. Scatter Plots, Line Plots, Histograms, Modified.
1. Chapter 15 Creating Charts 3 Charting Data in Word A chart or graph presents data visually. A chart depicts numeric data in a graphical format. If.
CREATING CHARTS By: Dr. Ennis - Cole OBJECTIVES b Identify the elements of an Excel chart b Identify the type of chart represents your data most effectively.
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.
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)
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,
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
Graphing in Excel X-Y Scatter Plot SCI 110 CCC Skills Training.
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.
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
3D-Graphs A 3D surface is defined as: z = f(x, y)
Lecture 25.
Lecture 25: Exploring data
Two-Dimensional Plots
Matrices and Arrays.
Introduction To MATLAB
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
MATLAB How to use (using M-files)
Introduction to MATLAB Plotting LAB 3
Plotting Signals in MATLAB
Introduction to Matlab
Welcome To Microsoft Word 2016
Presentation transcript:

NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks and Communication Department 1

Lecture Contents Networks and Communication Department  Graph in MatLab  2-D plotting  Creating and Type of graph  Using Basic Plotting Functions  Plotting Multiple graph in same plot  Formatting plots  Save,Print,Close and Export figure 2

 Creating and Type of graph  Using Basic Plotting Functions  Plotting Multiple graph in same plot  Formatting plots  Save,Print,Close and Export figure 2-D plotting 3 Networks and Communication Department

Creating Graph in MATLAB Networks and Communication Department 4 CommandDescription Plot, plot3Create 2-D graph and 3-D plotyy2-D line plots with y-axes on both left and right side loglogLog-log scale plot fplotPlot function between specified limits Line Plot Pie Charts, Bar Plots, and Histograms CommandDescription bar, bar3Bar graph 2-D, 3-D Pie, pie3Pie graph 2-D, 3-D histHistogram plot Discrete Graph CommandDescription Stem, stem3Plot discrete sequence data 2-D, 3-D stairsStairstep graph

Type of graph 5 Networks and Communication Department

POLTTING IN MATLAB Networks and Communication Department 6  Line plot FUNCTIONs:  Plot example:

POLTTING IN MATLAB Networks and Communication Department 7  Plot wit line specification example:

POLTTING IN MATLAB Networks and Communication Department 8  Plotyy ex:

POLTTING IN MATLAB Networks and Communication Department 9  Plot3 3D ex:

Pie Charts, Bar Plots, and Histograms Networks and Communication Department 10  Bar & br3 ex:

Pie Charts, Bar Plots, and Histograms Networks and Communication Department 11  Pie & hist ex:

Discrete Graph Networks and Communication Department 12  Stem and stairs ex:

Plotting Functions 13 Networks and Communication Department

2-D Plotting  Specify x-data and/or y-data  Specify color, line style and marker symbol (Default values used if ‘clm not specified)  Syntax:  Plotting single line:  Plotting multiple lines: plot(x1, y1, 'clm1', x2, y2, 'clm2',...) plot(xdata, ydata, 'color_linestyle_marker')

Line Specification Networks and Communication Department 15  Three components can be specified in the string specifiers along with the plotting command. They are:  Line style  Marker symbol  Color Line style Specifiers Meaning '-'Solid line (default) '--'Dashed line ':'Dotted line '-.'Dash-dot line MeaningColor Specifiers Blueb Cyanc Greeng Blackk Magentam Redr Yellowy MeaningMarkerMeanin g Marker downvcircleo triangle left<diamondd triangle right >hexagra m h up triangle^pentagr am p x -markxplus+ point. squares star*

2-D Plotting - example Create a Blue Sine Wave » x = 0:.1:2*pi; » y = sin(x); » plot(x,y) » x = 0:.1:2*pi; » y = sin(x); » plot(x,y)

Basic Task: Plot the function sin(x) between 0 ≤ x ≤4π  Create an x-array of 100 samples between 0 and 4 π.  Calculate sin(.) of the x-array  Plot the y-array >>x=linspace(0,4*pi,100); >>y=sin(x); >>plot(y)

Adding a Grid  GRID ON creates a grid on the current figure  GRID OFF turns off the grid from the current figure  GRID toggles the grid state »grid on

Controlling the Axes  Setting Axis Limits & Grids The axis command lets you to specify your own limits: axis([xmin xmax ymin ymax]) You can use the axis command to make the axes visible or invisible: axis on / axis off The grid command toggles grid lines on and off: grid on / grid off

Using Basic Plotting Functions Networks and Communication Department 20 Graphing functionsMATLAB command Label the horizontal axis.xlabel('text') Label the vertical axis.ylabel('text') Attach a title to the plot.title('text') Change the limits on the x and y axis.axis([xmin xmax ymin ymax]) "Keep plotting in the same window."hold on Turn off the "keep-plotting-in-the-same- window-command". hold off using the strings to label various curves legend(‘string1’,’string2’,’s tring3’) Places the string (text) on the plot at coordinate x,y relative to the plot axes. text(x,y,’string’) The following commands are useful when plotting: Note that all text must be put within ' '.

Multiple graph 21 Networks and Communication Department

Adding additional plots to a figure PLOTTING MULTIPLE GRAPHS IN THE SAME PLOT Plotting two (or more) graphs in one plot: 1.Using the plot command. 2. Using the hold on, hold off commands.

Adding additional plots to a figure  HOLD ON holds the current plot  HOLD OFF releases hold on current plot  HOLD toggles the hold state » x = 0:.1:2*pi; » y = sin(x); » plot(x,y,'b') » grid on » hold on » plot(x,exp(-x),'r:*') » x = 0:.1:2*pi; » y = sin(x); » plot(x,y,'b') » grid on » hold on » plot(x,exp(-x),'r:*')

Subplots Networks and Communication Department 24

Example  Example 1: Plot sin(x) and cos(x) over [0,2 π ], on the same plot with  different colours  Method 1: >> x = linspace(0,2*pi,1000); >> y = sin(x); >> z = cos(x); >> hold on; >> plot(x,y,‘b’); >> plot(x,z,‘g’); >> xlabel ‘X values’; >> ylabel ‘Y values’; >> title ‘Sample Plot’; >> legend (‘Y data’,‘Z data’); >> hold off; 25 Networks and Communication Department

Formatting 26 Networks and Communication Department

Formatting plots  A plot can be formatted to have a required appearance.  With formatting you can:  Add title to the plot.  Add labels to axes.  Change range of the axes.  Add legend.  Add text blocks.  Add grid.

Formatting plots There are two methods to format a plot: 1. Formatting commands. In this method commands, that make changes or additions to the plot, are entered after the plot() command. This can be done in the Command Window, or as part of a program in a script file. 2. Formatting the plot interactively in the Figure Window. In this method the plot is formatted by clicking on the plot and using the menu to make changes or add details.

Once a figure window is open, the figure can be formatted interactively. Use Figure, Axes, and Current Object-Properties in the Edit menu Click here to start the plot edit mode. Use the insert menu to FORMATTING A PLOT IN THE FIGURE WINDOW

Close and Save fig. 30 Networks and Communication Department

Close & Saving Plots  You can close all the current plots using ‘close all’  Often you may want to save a plot to include in another document, for example a Word document for a project report. From the figure window, save the plot in a file using the jpeg format. The jpeg format is pretty universal and compatible with MicroSoft Word and Powerpoint applications. It’s easy to do, give it a try.

Saving Figures files extenstion:.fig also you can save.jpeg.tif.bmp.pdf. »plot3d_soln

 using the Dialog Box: File Menu / Print... >>printdlg  from Command Line:  Controlling Page Layout: File Menu / Print Preview >>printpreview Printing Figures print print('argument1','argumen t2',...)

 Copying to Clipboard:  Options:(Edit / Copy Option)  Copying:(Edit / Copy Figure) Exporting Figures

Any Questions ? The End 35 Networks and Communication Department