SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 5”

Slides:



Advertisements
Similar presentations
Lecture 5.
Advertisements

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.
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.
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.
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:
Vectors and Plotting Selim Aksoy Bilkent University Department of Computer Engineering
EGR106 Week 4 Two Dimensional Plots Multiple Plots Plot Formatting Homework.
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.
Introduction to Matlab Jianguo Wang CSSCR September 2009.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
COMP 116: Introduction to Scientific Programming Lecture 5: Plotting, Scripts and publishing.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 9”
A L I MAM M OHAMMAD B IN S AUD I SLAMIC U NIVERSITY C OLLEGE OF S CIENCES D EPARTMENT OF M ATHEMATICS MATLAB 251 : MATH SOFTWARE Introduction to MATLAB.
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.
SOLUTION STEP 1 Use intercepts to graph an equation EXAMPLE 2 Graph the equation x + 2y = 4. x + 2y = 4 x =  x- intercept 4 Find the intercepts. x + 2(0)
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
EGR 115 Introduction to Computing for Engineers MATLAB Basics 4: Intro to Plotting Wednesday 10 Sept 2014 EGR 115 Introduction to Computing for Engineers.
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,
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.
ELG 3120 Lab 2 TAs Wei Zhang Ozgur Ekici (Section A) (Section B)
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 12”
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 )
EGR 115 Introduction to Computing for Engineers Complex Numbers & 3D Plots – Part 2 Friday 07 Nov 2014 EGR 115 Introduction to Computing for Engineers.
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.
EGR 115 Introduction to Computing for Engineers Complex Numbers & 3D Plots – Part 3 Monday 10 Nov 2014 EGR 115 Introduction to Computing for Engineers.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 11”
PATTERN RECOGNITION LAB 2 TA : Nouf Al-Harbi::
Plotting. 2 Initializing Vectors colon operator x = 1:2:10 x = y = 0:0.1:0.5 y =
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
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.
MATLAB LABORATORY SESSION
Computer Application in Engineering Design
3D-Graphs A 3D surface is defined as: z = f(x, y)
Lecture 25.
Lecture 25: Exploring data
Matrices and Arrays.
MatLab – Palm Chapter 5 2-D & 3-D 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)
Plotting Multiple Graphs In The Same Plot
CSCI N317 Computation for Scientific Applications Unit 1 – 5 MATLAB
Plotting Signals in MATLAB
How to Use MATLAB A Brief Introduction.
Electrical and Computer Engineering Department SUNY – New Paltz
Electrical and Computer Engineering Department SUNY – New Paltz
Presentation transcript:

SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 5”

SUNY-New Paltz objectives MATLAB’s high-level 2-D and 3-D plotting facilities Introduction to graphics

SUNY-New Paltz Basic 2-D graphs plot(x, y) plot(rand(1, 20)) ezplot(’tan(x)’) x = 0:pi/40:4*pi; plot(x, sin(x))

SUNY-New Paltz Drawing Lines Plot([0 4], [1 3])

Exercise SUNY-New Paltz

SUNY-New Paltz Exercise Plot a Polygon with N Sides N=9; theta=linspace(0,2*pi,N) plot(cos(theta),sin(theta)) axis equal Find an equation for all points Make 2 vectors for all points (x, y) Plot the vectors

SUNY-New Paltz Labels gtext(’text’) grid text(x, y, ’text’) title(’text’) xlabel(’horizontal’) ylabel(’vertical’)

SUNY-New Paltz Multiple plots on the same axes - Method 1 hold hold off plot(x,sin(x)); hold plot(x,cos(x));

SUNY-New Paltz Multiple plots on the same axes - Method 2 plot(x1, y1, x2, y2, x3, y3,... ) plotyy(x1, y1, x2, y2, x3, y3) plotyy(x,sin(x), x, 10*cos(x))

SUNY-New Paltz Multiple plots on the same axes - Method 3 Use Matrices Plot([x;x]’, [sin(x);cos(x)]’;

SUNY-New Paltz Line styles, markers and color plot(x, y, ’--’) plot(x, y, ’o’) plot(x, sin(x), x, cos(x), ’om--’) Different Colors: c, m, y, k, r, g, b, w

SUNY-New Paltz Axis limits axis( [xmin, xmax, ymin, ymax] ) axis auto v = axis axis manual axis equal

SUNY-New Paltz Multiple plots in a figure:subplot subplot(m, n, p) subplot(4, 1, 1) subplot(2, 2, 1) subplot(1, 4, 1)

c=['bgrk'] x=0:.1:10; for i=1:4 subplot(2,2,i) plot(x,sin(x+pi/2*i),c(i)) title(['sin(x+' num2str(i-1) '*pi/2)']) end SUNY-New Paltz Exercise Plot 4 sinusoids each lagging pi/2 from the previous one. The first sinusoid should have zero delay.

SUNY-New Paltz New Graphical Windows h = figure; figure(h) clf % clear figure cla % clear all figures Handle

SUNY-New Paltz Logarithmic plots semilogy(x, y) x = 0:0.01:4; semilogy(x, exp(x)), grid

SUNY-New Paltz Polar plots x = r cos(θ), y = r sin(θ), x = 0:pi/40:2*pi; polar(x, sin(2*x)) grid θ r

SUNY-New Paltz Plotting rapidly changing mathematical functions fplot x = 0.01:0.001:0. 1; plot(x, sin(1./x)) fplot(’sin(1/x)’, [ ])

SUNY-New Paltz 3-D plots t = 0:pi/50:10*pi; plot3(exp(-0.02*t).*sin(t), exp(-0.02*t).*cos(t),t),... xlabel(’x-axis’), ylabel(’y-axis’), zlabel(’z-axis’) plot3(x, y, z)

Exercise 1.Let t run from 0 to 10*pi 2.Plot the circle sin(t) versus cos(t) 3.Plot let the above circle to morph as a spiral by multiplying it by a 1/(10*pi)*t function. 4.Use a 3-D plot to rise the spiral from the x- y plane. SUNY-New Paltz