Recap Sum and Product Functions Matrix Size Function Variance and Standard Deviation Random Numbers Complex Numbers.

Slides:



Advertisements
Similar presentations
Lecture 5.
Advertisements

1 Chapter 4 Curve Plotting with MATLAB MATLAB provides some very powerful features for plotting and labeling curves. These operations can be performed.
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
Slides 2c: Using Spreadsheets for Modeling - Excel Concepts (Updated 1/19/2005) There are several reasons for the popularity of spreadsheets: –Data are.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Flow Charts, Loop Structures
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Al-Amer An Introduction to MATLAB Lesson 2: M-files Dr. Samir Al-Amer Term 061.
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.
Introduction to Matlab By: Dr. Maher O. EL-Ghossain.
Lecture 6 MATLAB functions Basics of Built-in Functions, Help Feature, Elementary Functions (e.g., Polynomials, Trigonometric Functions), Data Analysis,
Lecture II-2: Probability Review
Matlab intro The Environment
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
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()
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
„  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.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Recap Graphic Window Edit Window Start Button Matrices in MATLAB Scalar Operations Order of Operations Array Operations Matrix Addition Matrix Multiplication.
Chapter 14 Monte Carlo Simulation Introduction Find several parameters Parameter follow the specific probability distribution Generate parameter.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Introduction to MATLAB CBE 502 Mathematical Methods of Engineering Analysis.
MATLAB An Introduction to MATLAB (Matrix Laboratory) 1.
Matlab for Engineers Built-in Matlab Functions Chapter 3.
INTRODUCTION TO MATLAB LAB# 01
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Chapter 4 "Inheritance" Inheritance is a powerful feature that allows the reuse of code. However, be sure that functions applied to objects created at.
Matlab for Engineers Manipulating Matlab Matrices Chapter 4.
Recap Script M-file Editor/Debugger Window Cell Mode Chapter 3 “Built in MATLAB Function” Using Built-in Functions Using the HELP Feature Window HELP.
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.
MATLAB Environment ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
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.
Recap Saving Plots Summary of Chapter 5 Introduction of Chapter 6.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Introduction to Matlab
MATLAB for Engineers, by Holly Moore. ISBN © 2007 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is.
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 5 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.
CS 170 – INTRO TO SCIENTIFIC AND ENGINEERING PROGRAMMING.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
Chap 5-1 Chapter 5 Discrete Random Variables and Probability Distributions Statistics for Business and Economics 6 th Edition.
Structured Computer Programming EE 201 Introduction to MATLAB 7 for Engineers بسم الله الرحمن الرحيم King Abdulaziz University College of Engineering Dept.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Generating Random Variates
Computer Application in Engineering Design
Built-in MATLAB Functions Chapter 3
Lecture 25.
Two-Dimensional Plots
Chapter 1 Functions.
Comparing and Contrasting Functions
Communication and Coding Theory Lab(CS491)
Further Topics on Random Variables: Derived Distributions
Further Topics on Random Variables: Derived Distributions
Further Topics on Random Variables: Derived Distributions
Presentation transcript:

Recap Sum and Product Functions Matrix Size Function Variance and Standard Deviation Random Numbers Complex Numbers

Computational Limitations MATLAB includes functions to identify the largest real numbers and the largest integers the program can process

Special Values and Functions

Summary of Chapter General mathematical functions, such as exponential functions logarithmic functions roots Rounding functions Functions used in discrete mathematics, such as factoring functions prime-number functions Trigonometric functions, including standard trigonometric functions inverse trigonometric functions hyperbolic trigonometric functions trigonometric functions that use degrees instead of radians

Continued…. Data analysis functions, such as maxima and minima averages (mean and median) sums and products sorting standard deviation and variance Random-number generation for both uniform distributions Gaussian (normal) distributions Functions used with complex numbers

Chapter 5 Plotting

Two-Dimensional Plots The most useful plot for engineers is the x–y plot A set of ordered pairs is used to identify points on a two- dimensional graph; the points are then connected by straight lines The values of x and y may be measured or calculated Generally, the independent variable is given the name x and is plotted on the x -axis, and the dependent variable is given the name y and is plotted on the y -axis

Simple x-y Plots Once vectors of x -values and y -values have been defined, MATLAB makes it easy to create plots Suppose a set of time versus distance data were obtained through measurement We can store the time values in a vector called x and the distance values in a vector called y : x = [0:2:18]; y = [0, 0.33, 4.13, 6.29, 6.85, 11.19, 13.19, 13.96, 16.33, 18.17];

Continued…. To plot these points, use the plot command, with x and y as arguments: plot(x,y) A graphics window automatically opens, which MATLAB calls Figure 1

Titles, Labels and Grids Good engineering practice requires that we include axis labels and a title in our plot The following commands add a title, x - and y -axis labels, and a background grid: plot(x,y) xlabel('Time, sec') ylabel('Distance, ft') grid on

Continued…. As with any MATLAB commands, they could also be combined onto one or two lines, separated by commas: plot(x,y), title('Laboratory Experiment 1') xlabel('Time, sec' ), ylabel('Distance, ft'), grid

Multiple Plots If you are working in an M-file when you request a plot, and then you continue with more computations, MATLAB will generate and display the graphics window and then return immediately to execute the rest of the commands in the program If you request a second plot, the graph you created will be overwritten There are two possible solutions to this problem: Use the pause command to temporarily halt the execution of your M-file program so that you can examine the figure Create a second figure, using the figure function

Continued…. The pause command stops the program execution until any key is pressed If you want to pause for a specified number of seconds, use the pause(n) command, which will cause execution to pause for n seconds before continuing The figure command allows you to open a new figure window The next time you request a plot, it will be displayed in this new window

Continued…. For example: figure(2) opens a window named “Figure 2,” which then becomes the window used for subsequent plotting Executing figure without an input parameter causes a new window to open, numbered consecutively one up from the current window For example: if the current figure window is named “Figure 2,” executing figure will cause “Figure 3” to open