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.

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
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.
Plotting Selim Aksoy Bilkent University Department of Computer Engineering
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.
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’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.
Fall 2006AE6382 Design Computing1 Three Dimensional Plotting Learning Objectives –Understand the anatomy of a 3D plot –Basics of constructing plots in.
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
Introduction to Matlab 332:202 Discrete Mathematics Spring 2007.
EPSII 59:006 Spring Outline Managing Your Session File Usage  Saving Workspace  Loading Data Files  Creating M-files More on Matrices Review.
 1999 BG Mobasseri1 8/29/2015 MATLAB GRAPHICS - PART II ADVANCED PLOTTING June 4, ‘99.
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.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 5”
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
CMPS 1371 Introduction to Computing for Engineers PLOTTING.
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.
The Hong Kong Polytechnic University Industrial Centre 1 MatLAB Lesson 4 : Polynomial Edward Cheung Room W311g 2008.
MATLAB for Engineers, by Holly Moore. ISBN © 2007 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
CDS 301 Spring, 2013 CH3: MATLAB 3-D Visualization February 07, TBD Jie Zhang Copyright ©
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
Barak Shenhav Early Evolution Course 11 Feb 2001 MATLAB Visualization, Functions & Debugging.
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
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.
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.
Numerical Analysis 3D Plots. A numerical method is a technique for computing a numerical approximation of the solution to a mathematical problem.
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,
ELG 3120 Lab 2 TAs Wei Zhang Ozgur Ekici (Section A) (Section B)
ENG 1181 College of Engineering Engineering Education Innovation Center MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various.
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 )
Program design and algorithm development We will consider the design of your own toolbox to be included among the toolboxes already available with your.
GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Deniz Savas & Mike Griffiths May 2015.
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.
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.
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.
More Matlab Graphics and GUI Graphics subplots some useful commands 3D graphics GUI GUI controls The callback property Other essential properties.
PATTERN RECOGNITION LAB 2 TA : Nouf Al-Harbi::
An Introduction to Programming in Matlab Emily Blumenthal
EEE 242 Computer Tools for Electrical Engineering
Lecture 17 More Plotting Chapter 12 Matrices. Outline from Chapter D Plotting 11.4 Surface Plots 11.5 Interacting with Plotted Data.
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.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
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.
ENEE222 Elements of Discrete Signal Analysis Lab 11 1.
3D-Graphs A 3D surface is defined as: z = f(x, y)
Lecture 25.
Ch3 Graphics Overview of Plotting Editing Plots
Matrices and Arrays.
MatLab – Palm Chapter 5 2-D & 3-D Plots
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 – 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.
Introduction to MATLAB Plotting LAB 3
CSCI N317 Computation for Scientific Applications Unit 1 – 5 MATLAB
Plotting Signals in MATLAB
How to Use MATLAB A Brief Introduction.
Introduction to Matlab
Presentation transcript:

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

4. Graphics in MATLAB

I NTRODUCTION TO M ATLAB 4.1 Main functions

I NTRODUCTION TO M ATLAB To put mathematics in labels you can use matlab’s backslash notation (familiar to users of the TEX typesetting system)

I NTRODUCTION TO M ATLAB 4.2 2D Graphics Plot symbols and colors may be obtained when we use one of the 4 first previous commands, by adding a string S in those commands. PLOT(X,Y,S) or PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,…) Plot symbols and colors may be obtained when we use one of the 4 first previous commands, by adding a string S in those commands. PLOT(X,Y,S) or PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,…) Sketch curves or clouds of pointsplot Plot semi-logarithmic curvessemilogx semilogy Plot semi-logarithmic curvesloglog Plot graphs in polar coordinatespolar Plot two curves in the same graph with their own axis systemplotyy Plot functionsezplot Plot functions in polar coordinatesezpolar Graphic zoomzoom

I NTRODUCTION TO M ATLAB >> x= linspace(1,10,20); >> y=sin(x);z=cos(x); >> plot(x,y,'-.',x,z,'r') >> t = 0:.1:2*pi; >> subplot(2,2,1) >> plot(cos(t),sin(t)) >> subplot(2,2,2) >> plot(cos(t),sin(2*t)) >> subplot(2,2,3) >> plot(cos(t),sin(3*t)) >> subplot(2,2,4) >> plot(cos(t),sin(4*t))

I NTRODUCTION TO M ATLAB 4.3 Graphic symbols

I NTRODUCTION TO M ATLAB 4.4 Clearing the Figure Window You can clear the plot window by typing clf, which stands for ‘clear figure’. To get rid of a figure window entirely, type close. To get rid of all the figure windows, type close all. New figure windows can be created by typing figure. 4.5 Axes So far we have allowed matlab to choose the axes for our plots. You can change the axes in many ways: axis([xmin xmax ymin ymax ]) sets the axes’ minimum and maximum values. axis square makes the axes the same length axis equal makes the axes the same scale axis tight sets the axes limits to the range of the data axis auto allows matlab to choose axes limits axis off removes the axes leaving only the plotted data axis on puts the axes back again

I NTRODUCTION TO M ATLAB 4.6 3D graphics 1. Elementary commands (using matrix) 3. Tools commands 2. Elementary commands (math functions) Sketch linear currves and clouds of pointsplot3 Sketch a matrix under a meshed curvemesh Sketch a matrix under a surfaced curvesurf Sketch 2D functions and parametric functionsezplot3 Sketch 2D functions and parametric functions under a meshed curveezmesh Sketch 2D functions and parametric functions under a surfaced curveezsurf Transparent meshinghidden Color smoothingshading Lightinglight Add a bar of colorcolorbar Table of colorcolormap

I NTRODUCTION TO M ATLAB Examples: >> t=0:.1:2*pi; >> plot3(cos(3*t),sin(3*t),t) >> [X,Y]=meshgrid(-10:10); >> Z=sqrt(X.^2+Y.^2); >> mesh(X,Y,Z)

I NTRODUCTION TO M ATLAB An interesting function: peaks function >> [X,Y,Z]=peaks; >> mesh(X,Y,Z) >> [X,Y,Z]=peaks; >> surf(X,Y,Z)

I NTRODUCTION TO M ATLAB >>shading interp; >>axis tight; >>colorbar;

I NTRODUCTION TO M ATLAB >> [X,Y,Z]=peaks; >> contour(X,Y,Z) >> [X,Y,Z]=peaks; >> plot3(X,Y,Z) >> [X,Y,Z]=peaks; >> surfc(X,Y,Z); >>shading flat;

I NTRODUCTION TO M ATLAB Suppose we have the set of(X,Y) coordinates The (x,y) can be split into two matrices >>x=[1:4];y=[1:4]; >>[X,Y]=meshgrid(x,y) This is meshgrid principle