ECE2111 Signals and Systems UMD, Spring 2013 Experiment 1: Representation and manipulation of basic signals in MATLAB

Size: px
Start display at page:

Download "ECE2111 Signals and Systems UMD, Spring 2013 Experiment 1: Representation and manipulation of basic signals in MATLAB"

Transcription

1 ECE2111 Signals and Systems UMD, Spring 2013 Experiment 1: Representation and manipulation of basic signals in MATLAB MATLAB is a tool for doing numerical computations with matrices and vectors. It can also display information graphically. The best way to learn MATLAB is to start with matrices. Go to File->New->Script and start typing the code over there. 1)Vectors A)Creating vectors from given data: a)row Vector : To create a row vector type the elements with a space or a comma between the elements inside the square bracket. Create a vector with output: Yr= b)column Vector : To create the column vector, type the left square bracket [ and then enter the elements with a semicolon between them, or press the Enter key after each element. Type the right square bracket ] after the last element. Create a vector with output: Pop= B)Creating a vector with constant spacing by specifying the first term, the spacing and the last term Variable_name=m:q:n, Where m is first term q is spacing n is last term Create a vector A whose first term is 3, constant spacing is 2 and last term is 9. C)Creating a vector with constant spacing by specifying the first and last terms and the number of terms Page 1 of 11

2 Variable_name=linspace(xi,xf,n) Where xi is first term n is number of terms xf is last term Create a vector B whose first term is 3, number of terms is 3 and last term is 9. 2)Matrices A)Entering two 3x3 matrices and storing them in the variables A & B A = [ ; ; ]; B = [ ; ; ]; B)Compute the square of matrix A Asqr = A * A C)Compute the product A * B AB = A * B D)Compute the product B * A BA = B * A E)Add the two matrices A + B Sum = A + B F)Compute the square of matrix B G)The zeros, ones and eye Commands: a)use the zeros command to generate a matrix having 3 rows and 4 columns and all elements as 0. zr=zeros(3,4) b)use the ones command to generate a matrix having 5 rows and 6 columns and all elements as 1. Page 2 of 11

3 ne=ones(5,6) c)create an identity square matrix of order 5 using the eye command Idn=eye(5) H)Element-by-Element Operations: Element-by-element multiplication, division and exponentiation of two vectors or matrices is entered in MATLAB by typing aperiod in front of the arithmetic operator Symbol Description.* Multiplication.^ Exponentiation./ Right Division a)if A= And B= Give results for element-by-element multiplication and right division of matrices A and B. b)for the function y=(2x 2-5x+4) 3 /x 2, calculate the value of y for the following values of x:-2,-1,0,1,2,3,4,5 using element-by-element operations. 3)Generating Continuous Time Signals MATLAB only deals with discrete time signals, continuous time signals are represented in the form of discrete time signals. A)Plot y = sin(t) on the interval t = 0 to t = 10 then plot X = e (-2*t), Z = e (-0.2*t), Q = e (-0.02*t) The x-axis: in the time interval: 0 < t < 10 with increments of 0.3 t = [0:0.3:10]; y = sin(t); plot(t,y); x = exp(-2*t); z = exp(-0.2*t); q = exp(-0.02*t); figure,plot(t,x,t,z,t,q); B)Plot y = cos(t) on the interval t = 0 to t = 30 Page 3 of 11

4 The x-axis: in the time interval: 0 < t < 30 with increments of 0.2 C)For f=10hz, plot x=cos(2*pi*n*f*t) for n=1,2,3,4 on 4 different plots on the same figure using the subplot command t=[0:0.003:1]; x1=cos(2*pi*1*10*t); subplot(2,2,1),plot(t,x1) x2=cos(2*pi*2*10*t); subplot(2,2,2),plot(t,x2) x3=cos(2*pi*3*10*t); subplot(2,2,3),plot(t,x3) x4=cos(2*pi*4*10*t); subplot(2,2,4),plot(t,x4) j(π/8 t) D)Plot the complex exponential signal: y = e t = [0:0.3:20] y = exp(j*(pi/8)*t) plot(t,y) Question 1: What Warning do you get from Matlab after typing the code above? What you can do to improve? E)Repeat example D) using subplots and labeling the graphs t = [0:0.3:20]; y = exp(j*(pi/8)*t); subplot(2,2,1),plot(t,real(y)) title('real part of the signal exp(j*pi/8)*t ') xlabel('time (sec) ') ylabel('real part of y ') subplot(2,2,2),plot(t,imag(y)) title('imaginary part of the signal exp(j*pi/8)*t ') ylabel('imaginary part of y ') subplot(2,2,3), plot(t,abs(y)) title('magnitude of the signal exp(j*pi/8)*t ') ylabel('magnitude of y ') subplot(2,2,4), plot(t,angle(y)) title('phase of the signal exp(j*pi/8)*t ') ylabel('phase of y (radians) ') Page 4 of 11

5 Now replace the highlighted lines with the following lines subplot(2,2,4), plot(t,angle(y)*(180/pi)) title('phase of the signal exp(j*pi/8)*t ') ylabel('phase of y (degrees) ') Question 2: What s the difference after changing the code? 4)Operation with signals MATLAB allows you to add, subtract, multiply, divide, scale, and exponentiate signals. Be careful! The vector representation of the signals should have the same time origins and the same number of elements. A)Given the signals x 1 and x 2 perform the following operations: y 1 = x 1 + x 2 ; y 2 = x 1 - x 2 ; y 3 = x 1 * x 2 ; y 4 = x 1 / x 2 ; y 5 = 2 x 1 ; y 6 = (x 1 ) (The above line is NOT codes.) Matlab codes are given as follows: % - A symbol used to make comments for coding; codes starting with % are not executed % Defining the signals x1 = 5*sin((pi/4)*[0:0.1:15]); x2 = 3*cos((pi/7)*[0:0.1:15]); % Plotting the signals subplot(2,4,1), plot(x1) title('x1 = 5 sin(pi/4)t ') ylabel('x1 (volts) ') subplot(2,4,2), plot(x2) title('x2 = 3 cos(pi/7)t ') ylabel('x2 (volts) ') % Addition y1 = x1 + x2; % addition y2 = x1 - x2; % subtraction y3 = x1.* x2; % multiplication y4 = x1./ x2; % division y5 = 2*x1; % scaling y6 = x1.^3; % exponentiation % Plotting the signals subplot(2,4,3), plot(y1) title('y1 = x1 + x2 ') 3 Page 5 of 11

6 ylabel('y1 (volts) ') subplot(2,4,4), plot(y2) title('y2 = x1 x2 ') ylabel('y2 (volts) ') subplot(2,4,5), plot(y3) title('y3 = x1 * x2 ') ylabel('y3 (volts)^2 ') subplot(2,4,6), plot(y4) title('y4 = x1 / x2 ') ylabel('x1/x2 ') subplot(2,4,7), plot(y5) title('y5 = 2*x1 ') ylabel('y5 (volts) ') subplot(2,4,8), plot(y6) title('y6 = x1 ^ 3 ') ylabel('y6 (volts)^3 ') 5)Generating Discrete Time Signals A)Plot the discrete time signal defined as: x[n] = 2n -3 < n < 3, 0 otherwise a) Plotting only the interval [ ] n = [-3: 3] x = 2 * n b).- Plotting the time interval [ ] n = [-3: 3] x = 2 * n n = [-5: 5] x = [ 0 0 x 0 0] c).- Plotting the time interval [ ] n = [-3: 3] x = 2 * n n = [-5: 5] x = [ 0 0 x 0 0] Page 6 of 11

7 n = [-50:50] x = [zeros(1,45) x zeros(1,45)]; B)Generate and plot the sequence g[n] = A (a ) n with A = 10 and a = -0.9, -10 < n < 10, 0 otherwise n = [-10:1:10] ; % defining the samples g = 10*(-0.9).^n; % defining the sequence figure % open a new window for the graphic stem(n,g) axis([-10, 10, -30, 30]); xlabel('sample number, n '); ylabel('g[n] '); title('exponential sequence '); grid text(0.6, 15, 'g[n] = 10(-0.9).^n '); 6)Control flow MATLAB has the following flow control constructs: if statements switch statements for loops while loops break statements The if, for, switch and while statements need to terminate with an end statement. A)if statement: x=-3; if x>0 str='positive'; elseif x<0 str='negative'; elseif x==0 str='zero'; else str='error'; end What is the value of str after execution of the above code? (type str) Shortcut to convert between codes and comments: Select the codes->ctrl R: to convert the codes to comments Select the codes->ctrl T: to convert the comments back to codes B)while statement: Page 7 of 11

8 x=-10; while x<0 x=x+1; end What is the value of x after execution of the above loop? C)for loop: x=0; for i=1:10 x=x+1; end What is the value of x after execution of the for loop? D)break statement: The break statement lets you exit early from a for or a while loop: x=-10; while x<0 x=x+2; if x==-2 break; end end What is the value of X? E)Repeat example 3C using while loop where n goes from 1 to 4. 7)Exercise: Write the code to get output exactly same as shown in the figure below Page 8 of 11

9 Demo: 1)Show b part of 2I 2)Show 3B 3)Show 6E 4)Show 7 Report Requirements: Individual lab report Attached with the cover page (available on website) This lab report should contain the following: 1. Statement of the Problem: Define the problem and goals of the experiment. 2. Results: a. Present all the results for 1 and 2 b. Print out all the plots of 3, 4 and 5 and provide explanation c. Answer the questions in 3 d. Provide the results from Control Flow 3. Exercises: Attached 4. Conclusions: Give comments to your results. Exercises: 1. Which of the following is a discrete time signal: a) y(t) = 5 sin (ω t) b) y[n] = 5 sin(20 π f n) c) y(t) = e (-2*t) Refer to the Matlab script below to answer questions 2 & 3: n = [-3: 3] x = 2 * n n = [-5: 5] x = [ 0 0 x 0 0] n = [-50:50] x = [zeros(1,45) x zeros(1,45)]; Page 9 of 11

10 2. What does the command stem do? a) to plot a continuous time signal b) to plot a discrete time signal 3. What does the command zeros do? x = [zeros(1,45) x zeros(1,45)]; (Two correct answers) a) to make the vectors n and x of same length b) to plot a discrete time signal c) to pad the vector x with 45 zeros on the left and 45 zeros on the right 4. For a signal y(t) = e (-2*t), what matlab command will be used to plot the magnitude of the signal: a) plot(t,mag(y)) b) plot(t,abs(y)) c) plot(t,real(y)) d) plot(t,imag(y)) Page 10 of 11

11 5. For a complex exponential signal: y = e j(π/8 t)), which of the following is the correct magnitude plot: Page 11 of 11

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB, Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB, Part I: Basics MATLAB Environment Getting Help Variables Vectors, Matrices, and

More information

MATLAB BASICS. Instructor: Prof. Shahrouk Ahmadi. TA: Kartik Bulusu

MATLAB BASICS. Instructor: Prof. Shahrouk Ahmadi. TA: Kartik Bulusu MATLAB BASICS Instructor: Prof. Shahrouk Ahmadi 1. What are M-files TA: Kartik Bulusu M-files are files that contain a collection of MATLAB commands or are used to define new MATLAB functions. For the

More information

Math Assignment 3 - Linear Algebra

Math Assignment 3 - Linear Algebra Math 216 - Assignment 3 - Linear Algebra Due: Tuesday, March 27. Nothing accepted after Thursday, March 29. This is worth 15 points. 10% points off for being late. You may work by yourself or in pairs.

More information

Escola Federal de Engenharia de Itajubá

Escola Federal de Engenharia de Itajubá Escola Federal de Engenharia de Itajubá Departamento de Engenharia Mecânica Pós-Graduação em Engenharia Mecânica MPF04 ANÁLISE DE SINAIS E AQUISIÇÃO DE DADOS SINAIS E SISTEMAS Trabalho 01 (MATLAB) Prof.

More information

Homework 1 Solutions

Homework 1 Solutions 18-9 Signals and Systems Profs. Byron Yu and Pulkit Grover Fall 18 Homework 1 Solutions Part One 1. (8 points) Consider the DT signal given by the algorithm: x[] = 1 x[1] = x[n] = x[n 1] x[n ] (a) Plot

More information

Laboratory handout 1 Mathematical preliminaries

Laboratory handout 1 Mathematical preliminaries laboratory handouts, me 340 2 Laboratory handout 1 Mathematical preliminaries In this handout, an expression on the left of the symbol := is defined in terms of the expression on the right. In contrast,

More information

GRAPHIC WEEK 7 DR. USMAN ULLAH SHEIKH DR. MUSA MOHD MOKJI DR. MICHAEL TAN LOONG PENG DR. AMIRJAN NAWABJAN DR. MOHD ADIB SARIJARI

GRAPHIC WEEK 7 DR. USMAN ULLAH SHEIKH DR. MUSA MOHD MOKJI DR. MICHAEL TAN LOONG PENG DR. AMIRJAN NAWABJAN DR. MOHD ADIB SARIJARI GRAPHIC SKEE1022 SCIENTIFIC PROGRAMMING WEEK 7 DR. USMAN ULLAH SHEIKH DR. MUSA MOHD MOKJI DR. MICHAEL TAN LOONG PENG DR. AMIRJAN NAWABJAN DR. MOHD ADIB SARIJARI 1 OBJECTIVE 2-dimensional line plot function

More information

Symbolic Solution of higher order equations

Symbolic Solution of higher order equations Math 216 - Assignment 4 - Higher Order Equations and Systems of Equations Due: Monday, April 16. Nothing accepted after Tuesday, April 17. This is worth 15 points. 10% points off for being late. You may

More information

Matlab Exercise 0 Due 1/25/06

Matlab Exercise 0 Due 1/25/06 Matlab Exercise 0 Due 1/25/06 Geop 523 Theoretical Seismology January 18, 2006 Much of our work in this class will be done using Matlab. The goal of this exercise is to get you familiar with using Matlab

More information

MOL410/510 Problem Set 1 - Linear Algebra - Due Friday Sept. 30

MOL410/510 Problem Set 1 - Linear Algebra - Due Friday Sept. 30 MOL40/50 Problem Set - Linear Algebra - Due Friday Sept. 30 Use lab notes to help solve these problems. Problems marked MUST DO are required for full credit. For the remainder of the problems, do as many

More information

Note: The command name is upper case in the description given by help, but must be lower case in actual use. And the backslash Anb is dierent when A i

Note: The command name is upper case in the description given by help, but must be lower case in actual use. And the backslash Anb is dierent when A i MATLAB Tutorial You need a small number of basic commands to start using MATLAB. This short tutorial describes those fundamental commands. You need to create vectors and matrices, to change them, and to

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for solving higher order ODEs and

More information

Companion. Jeffrey E. Jones

Companion. Jeffrey E. Jones MATLAB7 Companion 1O11OO1O1O1OOOO1O1OO1111O1O1OO 1O1O1OO1OO1O11OOO1O111O1O1O1O1 O11O1O1O11O1O1O1O1OO1O11O1O1O1 O1O1O1111O11O1O1OO1O1O1O1OOOOO O1111O1O1O1O1O1O1OO1OO1OO1OOO1 O1O11111O1O1O1O1O Jeffrey E.

More information

Digital Signal Processing Lab 3: Discrete Fourier Transform

Digital Signal Processing Lab 3: Discrete Fourier Transform Digital Signal Processing Lab 3: Discrete Fourier Transform Discrete Time Fourier Transform (DTFT) The discrete-time Fourier transform (DTFT) of a sequence x[n] is given by (3.1) which is a continuous

More information

Matlab for Review. NDSU Matlab Review pg 1

Matlab for Review. NDSU Matlab Review pg 1 NDSU Matlab Review pg 1 Becoming familiar with MATLAB The console The editor The graphics windows The help menu Saving your data (diary) General environment and the console Matlab for Review Simple numerical

More information

EE -213 BASIC CIRCUIT ANALYSIS LAB MANUAL

EE -213 BASIC CIRCUIT ANALYSIS LAB MANUAL EE -213 BASIC CIRCUIT ANALYSIS LAB MANUAL EE 213 Fall 2009 LABORATORY #1 INTRODUCTION TO MATLAB INTRODUCTION The purpose of this laboratory is to introduce you to Matlab and to illustrate some of its circuit

More information

1 Introduction & Objective

1 Introduction & Objective Signal Processing First Lab 13: Numerical Evaluation of Fourier Series Pre-Lab and Warm-Up: You should read at least the Pre-Lab and Warm-up sections of this lab assignment and go over all exercises in

More information

Introduction to Computational Neuroscience

Introduction to Computational Neuroscience CSE2330 Introduction to Computational Neuroscience Basic computational tools and concepts Tutorial 1 Duration: two weeks 1.1 About this tutorial The objective of this tutorial is to introduce you to: the

More information

EEE161 Applied Electromagnetics Laboratory 1

EEE161 Applied Electromagnetics Laboratory 1 Dr. Milica Marković Applied Electromagnetics Laboratory page 1 EEE161 Applied Electromagnetics Laboratory 1 Instructor: Dr. Milica Marković Office: Riverside Hall 3028 Email: milica@csus.edu Web:http://gaia.ecs.csus.edu/

More information

2015 SUMMER MATH PACKET

2015 SUMMER MATH PACKET Name: Date: 05 SUMMER MATH PACKET College Algebra Trig. - I understand that the purpose of the summer packet is for my child to review the topics they have already mastered in previous math classes and

More information

CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN

CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN 6. Introduction Frequency Response This chapter will begin with the state space form of the equations of motion. We will use Laplace transforms to

More information

LAB 2: DTFT, DFT, and DFT Spectral Analysis Summer 2011

LAB 2: DTFT, DFT, and DFT Spectral Analysis Summer 2011 University of Illinois at Urbana-Champaign Department of Electrical and Computer Engineering ECE 311: Digital Signal Processing Lab Chandra Radhakrishnan Peter Kairouz LAB 2: DTFT, DFT, and DFT Spectral

More information

New Mexico Tech Hyd 510

New Mexico Tech Hyd 510 Vectors vector - has magnitude and direction (e.g. velocity, specific discharge, hydraulic gradient) scalar - has magnitude only (e.g. porosity, specific yield, storage coefficient) unit vector - a unit

More information

MATLAB and Mathematical Introduction Will be discussed in class on 1/24/11

MATLAB and Mathematical Introduction Will be discussed in class on 1/24/11 MATLAB and Mathematical Introduction Will be discussed in class on 1/24/11 GEOP 523; Theoretical Seismology January 17, 2011 Much of our work in this class will be done using MATLAB. The goal of this exercise

More information

ECE 3793 Matlab Project 3

ECE 3793 Matlab Project 3 ECE 3793 Matlab Project 3 Spring 2017 Dr. Havlicek DUE: 04/25/2017, 11:59 PM What to Turn In: Make one file that contains your solution for this assignment. It can be an MS WORD file or a PDF file. Make

More information

Lab 02 - Signal Transformations using MATLAB

Lab 02 - Signal Transformations using MATLAB Lab 02 - Signal Transformations using MATLAB 2.1 Transformations of the Time Variable for Continuous-Time Signals: In many cases, there are signals related to each other with operations performed in the

More information

LAB 1: MATLAB - Introduction to Programming. Objective:

LAB 1: MATLAB - Introduction to Programming. Objective: LAB 1: MATLAB - Introduction to Programming Objective: The objective of this laboratory is to review how to use MATLAB as a programming tool and to review a classic analytical solution to a steady-state

More information

CHAPTER 11 FREQUENCY RESPONSE: MODAL STATE SPACE FORM

CHAPTER 11 FREQUENCY RESPONSE: MODAL STATE SPACE FORM CHAPTER 11 FREQUENCY RESPONSE: MODAL STATE SPACE FORM 11.1 Introduction In Chapter 1 we constructed the modal form of the state equations for the overall frequency response as well as for the individual

More information

EE -213 BASIC CIRCUIT ANALYSIS LAB MANUAL

EE -213 BASIC CIRCUIT ANALYSIS LAB MANUAL EE -213 BASIC CIRCUIT ANALYSIS LAB MANUAL EE 213 Spring 2008 LABORATORY #1 INTRODUCTION TO MATLAB INTRODUCTION The purpose of this laboratory is to introduce you to Matlab and to illustrate some of its

More information

TOPIC 2 Computer application for manipulating matrix using MATLAB

TOPIC 2 Computer application for manipulating matrix using MATLAB YOGYAKARTA STATE UNIVERSITY MATHEMATICS AND NATURAL SCIENCES FACULTY MATHEMATICS EDUCATION STUDY PROGRAM TOPIC 2 Computer application for manipulating matrix using MATLAB Definition of Matrices in MATLAB

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MATLAB sessions: Laboratory 4 MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for

More information

Chapter 2: Numeric, Cell, and Structure Arrays

Chapter 2: Numeric, Cell, and Structure Arrays Chapter 2: Numeric, Cell, and Structure Arrays Topics Covered: Vectors Definition Addition Multiplication Scalar, Dot, Cross Matrices Row, Column, Square Transpose Addition Multiplication Scalar-Matrix,

More information

Linear Systems of Differential Equations

Linear Systems of Differential Equations Chapter 5 Linear Systems of Differential Equations Project 5. Automatic Solution of Linear Systems Calculations with numerical matrices of order greater than 3 are most frequently carried out with the

More information

ENGR Spring Exam 2

ENGR Spring Exam 2 ENGR 1300 Spring 013 Exam INSTRUCTIONS: Duration: 60 minutes Keep your eyes on your own work! Keep your work covered at all times! 1. Each student is responsible for following directions. Read carefully..

More information

Matrices A matrix is a rectangular array of numbers. For example, the following rectangular arrays of numbers are matrices: 2 1 2

Matrices A matrix is a rectangular array of numbers. For example, the following rectangular arrays of numbers are matrices: 2 1 2 Matrices A matrix is a rectangular array of numbers For example, the following rectangular arrays of numbers are matrices: 7 A = B = C = 3 6 5 8 0 6 D = [ 3 5 7 9 E = 8 7653 0 Matrices vary in size An

More information

Astronomy Using scientific calculators

Astronomy Using scientific calculators Astronomy 113 - Using scientific calculators 0. Introduction For some of the exercises in this lab you will need to use a scientific calculator. You can bring your own, use the few calculators available

More information

Assignment 1b: due Tues Nov 3rd at 11:59pm

Assignment 1b: due Tues Nov 3rd at 11:59pm n Today s Lecture: n n Vectorized computation Introduction to graphics n Announcements:. n Assignment 1b: due Tues Nov 3rd at 11:59pm 1 Monte Carlo Approximation of π Throw N darts L L/2 Sq. area = N =

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 75 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP. Use MATLAB solvers for solving higher order ODEs and systems

More information

Mon Jan Improved acceleration models: linear and quadratic drag forces. Announcements: Warm-up Exercise:

Mon Jan Improved acceleration models: linear and quadratic drag forces. Announcements: Warm-up Exercise: Math 2250-004 Week 4 notes We will not necessarily finish the material from a given day's notes on that day. We may also add or subtract some material as the week progresses, but these notes represent

More information

Register machines L2 18

Register machines L2 18 Register machines L2 18 Algorithms, informally L2 19 No precise definition of algorithm at the time Hilbert posed the Entscheidungsproblem, just examples. Common features of the examples: finite description

More information

Laboratory 1. Solving differential equations with nonzero initial conditions

Laboratory 1. Solving differential equations with nonzero initial conditions Laboratory 1 Solving differential equations with nonzero initial conditions 1. Purpose of the exercise: - learning symbolic and numerical methods of differential equations solving with MATLAB - using Simulink

More information

FFT Octave Codes (1B) Young Won Lim 7/6/17

FFT Octave Codes (1B) Young Won Lim 7/6/17 FFT Octave Codes (1B) Copyright (c) 2009-2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any

More information

MAT 275 Laboratory 7 Laplace Transform and the Symbolic Math Toolbox

MAT 275 Laboratory 7 Laplace Transform and the Symbolic Math Toolbox Laplace Transform and the Symbolic Math Toolbox 1 MAT 275 Laboratory 7 Laplace Transform and the Symbolic Math Toolbox In this laboratory session we will learn how to 1. Use the Symbolic Math Toolbox 2.

More information

CHAPTER 12 TIME DOMAIN: MODAL STATE SPACE FORM

CHAPTER 12 TIME DOMAIN: MODAL STATE SPACE FORM CHAPTER 1 TIME DOMAIN: MODAL STATE SPACE FORM 1.1 Introduction In Chapter 7 we derived the equations of motion in modal form for the system in Figure 1.1. In this chapter we will convert the modal form

More information

EE nd Order Time and Frequency Response (Using MatLab)

EE nd Order Time and Frequency Response (Using MatLab) EE 2302 2 nd Order Time and Frequency Response (Using MatLab) Objective: The student should become acquainted with time and frequency domain analysis of linear systems using Matlab. In addition, the student

More information

+ MATRIX VARIABLES AND TWO DIMENSIONAL ARRAYS

+ MATRIX VARIABLES AND TWO DIMENSIONAL ARRAYS + MATRIX VARIABLES AND TWO DIMENSIONAL ARRAYS Matrices are organized rows and columns of numbers that mathematical operations can be performed on. MATLAB is organized around the rules of matrix operations.

More information

Numerical Methods Lecture 2 Simultaneous Equations

Numerical Methods Lecture 2 Simultaneous Equations Numerical Methods Lecture 2 Simultaneous Equations Topics: matrix operations solving systems of equations pages 58-62 are a repeat of matrix notes. New material begins on page 63. Matrix operations: Mathcad

More information

3. Array and Matrix Operations

3. Array and Matrix Operations 3. Array and Matrix Operations Almost anything you learned about in your linear algebra classmatlab has a command to do. Here is a brief summary of the most useful ones for physics. In MATLAB matrices

More information

Bfh Ti Control F Ws 2008/2009 Lab Matlab-1

Bfh Ti Control F Ws 2008/2009 Lab Matlab-1 Bfh Ti Control F Ws 2008/2009 Lab Matlab-1 Theme: The very first steps with Matlab. Goals: After this laboratory you should be able to solve simple numerical engineering problems with Matlab. Furthermore,

More information

INTERSECTIONS OF PLANES

INTERSECTIONS OF PLANES GG303 Lab 4 9/17/14 1 INTERSECTIONS OF PLANES Lab 4 (125 points total) Read each exercise completely before you start it so that you understand the problem-solving approach you are asked to execute This

More information

USE OF MATLAB TO UNDERSTAND BASIC MATHEMATICS

USE OF MATLAB TO UNDERSTAND BASIC MATHEMATICS USE OF MATLAB TO UNDERSTAND BASIC MATHEMATICS Sanjay Gupta P. G. Department of Mathematics, Dev Samaj College For Women, Punjab ( India ) ABSTRACT In this paper, we talk about the ways in which computer

More information

7.3. Determinants. Introduction. Prerequisites. Learning Outcomes

7.3. Determinants. Introduction. Prerequisites. Learning Outcomes Determinants 7.3 Introduction Among other uses, determinants allow us to determine whether a system of linear equations has a unique solution or not. The evaluation of a determinant is a key skill in engineering

More information

Section Matrices and Systems of Linear Eqns.

Section Matrices and Systems of Linear Eqns. QUIZ: strings Section 14.3 Matrices and Systems of Linear Eqns. Remembering matrices from Ch.2 How to test if 2 matrices are equal Assume equal until proved wrong! else? myflag = logical(1) How to test

More information

Digital Signal Octave Codes (0A)

Digital Signal Octave Codes (0A) Digital Signal Periodic Conditions Copyright (c) 2009-2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version

More information

INTERSECTIONS OF PLANES

INTERSECTIONS OF PLANES GG303 Lab 4 10/9/13 1 INTERSECTIONS OF PLANES Lab 4 Read each exercise completely before you start it so that you understand the problem-solving approach you are asked to execute This will help keep the

More information

Chapter 1 Linear Equations. 1.1 Systems of Linear Equations

Chapter 1 Linear Equations. 1.1 Systems of Linear Equations Chapter Linear Equations. Systems of Linear Equations A linear equation in the n variables x, x 2,..., x n is one that can be expressed in the form a x + a 2 x 2 + + a n x n = b where a, a 2,..., a n and

More information

Vector Spaces. 1 Theory. 2 Matlab. Rules and Operations

Vector Spaces. 1 Theory. 2 Matlab. Rules and Operations Vector Spaces Rules and Operations 1 Theory Recall that we can specify a point in the plane by an ordered pair of numbers or coordinates (x, y) and a point in space with an order triple of numbers (x,

More information

Topic 3. Matrix Operations Matrix & Linear Algebra Operations Element-by-Element(array) Operations

Topic 3. Matrix Operations Matrix & Linear Algebra Operations Element-by-Element(array) Operations Topic 3 Matrix Operations Matrix & Linear Algebra Operations Element-by-Element(array) Operations 1 Introduction Matlab is designed to carry out advanced array operations that have many applications in

More information

MATLAB crash course 1 / 27. MATLAB crash course. Cesar E. Tamayo Economics - Rutgers. September 27th, /27

MATLAB crash course 1 / 27. MATLAB crash course. Cesar E. Tamayo Economics - Rutgers. September 27th, /27 1/27 MATLAB crash course 1 / 27 MATLAB crash course Cesar E. Tamayo Economics - Rutgers September 27th, 2013 2/27 MATLAB crash course 2 / 27 Program Program I Interface: layout, menus, help, etc.. I Vectors

More information

Solutions to Systems of Linear Equations

Solutions to Systems of Linear Equations Solutions to Systems of Linear Equations 5 Overview In this chapter we studying the solution of sets of simultaneous linear equations using matrix methods. The first section considers the graphical interpretation

More information

I&C 6N. Computational Linear Algebra

I&C 6N. Computational Linear Algebra I&C 6N Computational Linear Algebra 1 Lecture 1: Scalars and Vectors What is a scalar? Computer representation of a scalar Scalar Equality Scalar Operations Addition and Multiplication What is a vector?

More information

LAB MANUAL. Department of Electrical & Electronics Engineering. University Institute of Engineering and Technology, Panjab University, Chandigarh

LAB MANUAL. Department of Electrical & Electronics Engineering. University Institute of Engineering and Technology, Panjab University, Chandigarh Department of Electrical & Electronics Engineering LAB MANUAL SUBJECT: DIGITAL SIGNAL PROCESSING Lab [EE752] B.E/B.E MBA Third Year VI Semester (Branch: EEE) University Institute of Engineering and Technology,

More information

Chapter I: Hands-on experience in SCILAB operations

Chapter I: Hands-on experience in SCILAB operations Chapter I: Hands-on experience in SCILAB operations Introduction to SCILAB SCILAB is a numerical mathematical equation solver which involves a powerful open computing environment for engineering and scientific

More information

Lesson 11: Mass-Spring, Resonance and ode45

Lesson 11: Mass-Spring, Resonance and ode45 Lesson 11: Mass-Spring, Resonance and ode45 11.1 Applied Problem. Trucks and cars have springs and shock absorbers to make a comfortable and safe ride. Without good shock absorbers, the truck or car will

More information

ECE 301 Fall 2011 Division 1. Homework 1 Solutions.

ECE 301 Fall 2011 Division 1. Homework 1 Solutions. ECE 3 Fall 2 Division. Homework Solutions. Reading: Course information handout on the course website; textbook sections.,.,.2,.3,.4; online review notes on complex numbers. Problem. For each discrete-time

More information

These videos and handouts are supplemental documents of paper X. Li, Z. Huang. An Inverted Classroom Approach to Educate MATLAB in Chemical Process

These videos and handouts are supplemental documents of paper X. Li, Z. Huang. An Inverted Classroom Approach to Educate MATLAB in Chemical Process These videos and handouts are supplemental documents of paper X. Li, Z. Huang. An Inverted Classroom Approach to Educate MATLAB in Chemical Process Control, Education for Chemical Engineers, 9, -, 7. The

More information

MATLAB Ordinary Differential Equation (ODE) solver for a simple example 1. Introduction

MATLAB Ordinary Differential Equation (ODE) solver for a simple example 1. Introduction MATLAB Ordinary Differential Equation (ODE) solver for a simple example 1. Introduction Differential equations are a convenient way to express mathematically a change of a dependent variable (e.g. concentration

More information

Who am I? Math 1080: Numerical Linear Algebra. Books. Format

Who am I? Math 1080: Numerical Linear Algebra. Books. Format Who am I? Math 18: Numerical Linear Algebra M M Sussman sussmanm@mathpittedu Office Hours: MW 1:45PM-2:45PM, Thack 622 Part-time faculty in Math Dept Experience at Bettis lab Administer 27/271 Numerical

More information

Statistical methods. Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra

Statistical methods. Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra Statistical methods Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra Statistical methods Generating random numbers MATLAB has many built-in functions

More information

Linear Algebra in LabVIEW

Linear Algebra in LabVIEW University College of Southeast Norway Linear Algebra in LabVIEW Hans-Petter Halvorsen, 2016-10-31 http://home.hit.no/~hansha Preface This document explains the basic concepts of Linear Algebra and how

More information

Digital Signal Processing, Lecture 2 Frequency description continued, DFT

Digital Signal Processing, Lecture 2 Frequency description continued, DFT Outline cture 2 2 Digital Signal Processing, cture 2 Frequency description continued, DFT Thomas Schön Division of Automatic Control Department of Electrical Engineering Linköping i University it E-mail:

More information

Name (print): Lab (circle): W8 Th8 Th11 Th2 F8. θ (radians) θ (degrees) cos θ sin θ π/ /2 1/2 π/4 45 2/2 2/2 π/3 60 1/2 3/2 π/

Name (print): Lab (circle): W8 Th8 Th11 Th2 F8. θ (radians) θ (degrees) cos θ sin θ π/ /2 1/2 π/4 45 2/2 2/2 π/3 60 1/2 3/2 π/ Name (print): Lab (circle): W8 Th8 Th11 Th2 F8 Trigonometric Identities ( cos(θ) = cos(θ) sin(θ) = sin(θ) sin(θ) = cos θ π ) 2 Cosines and Sines of common angles Euler s Formula θ (radians) θ (degrees)

More information

MATLAB Project 2: MATH240, Spring 2013

MATLAB Project 2: MATH240, Spring 2013 1. Method MATLAB Project 2: MATH240, Spring 2013 This page is more information which can be helpful for your MATLAB work, including some new commands. You re responsible for knowing what s been done before.

More information

EE3210 Lab 3: Periodic Signal Representation by Fourier Series

EE3210 Lab 3: Periodic Signal Representation by Fourier Series City University of Hong Kong Department of Electronic Engineering EE321 Lab 3: Periodic Signal Representation by Fourier Series Prelab: Read the Background section. Complete Section 2.2(b), which asks

More information

Matlab Section. November 8, 2005

Matlab Section. November 8, 2005 Matlab Section November 8, 2005 1 1 General commands Clear all variables from memory : clear all Close all figure windows : close all Save a variable in.mat format : save filename name of variable Load

More information

CSCI 239 Discrete Structures of Computer Science Lab 6 Vectors and Matrices

CSCI 239 Discrete Structures of Computer Science Lab 6 Vectors and Matrices CSCI 239 Discrete Structures of Computer Science Lab 6 Vectors and Matrices This lab consists of exercises on real-valued vectors and matrices. Most of the exercises will required pencil and paper. Put

More information

COMPUTING AND DATA ANALYSIS WITH EXCEL. Matrix manipulation and systems of linear equations

COMPUTING AND DATA ANALYSIS WITH EXCEL. Matrix manipulation and systems of linear equations COMPUTING AND DATA ANALYSIS WITH EXCEL Matrix manipulation and systems of linear equations Outline 1 Matrices Addition Subtraction Excel functions that return more than one cell Solving systems of linear

More information

DOING PHYSICS WITH MATLAB OSCILLATIONS

DOING PHYSICS WITH MATLAB OSCILLATIONS DOING PHYSICS WITH MATLAB OSCILLATIONS Graphical User Interface (GUI): Simple Harmonic Motion and the Sine Function Ian Cooper School of Physics, University of Sydney ian.cooper@sydney.edu.au DOWNLOAD

More information

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB Applied Linear Algebra in Geoscience Using MATLAB (Mathematical Operations with Arrays) Contents Getting Started Matrices Creating Arrays Linear equations Mathematical Operations with Arrays Using Script

More information

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations Lab 2 Worksheet Problems Problem : Geometry and Linear Equations Linear algebra is, first and foremost, the study of systems of linear equations. You are going to encounter linear systems frequently in

More information

Lecture 5b: Starting Matlab

Lecture 5b: Starting Matlab Lecture 5b: Starting Matlab James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University August 7, 2013 Outline 1 Resources 2 Starting Matlab 3 Homework

More information

BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012

BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012 BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012 Introduction Maple is a powerful collection of routines to aid in the solution of mathematical problems

More information

DFT Octave Codes (0B) Young Won Lim 4/15/17

DFT Octave Codes (0B) Young Won Lim 4/15/17 Copyright (c) 2009-2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published

More information

An Introduction to Scilab for EE 210 Circuits Tony Richardson

An Introduction to Scilab for EE 210 Circuits Tony Richardson An Introduction to Scilab for EE 210 Circuits Tony Richardson Introduction This is a brief introduction to Scilab. It is recommended that you try the examples as you read through this introduction. What

More information

Lab 6: Linear Algebra

Lab 6: Linear Algebra 6.1 Introduction Lab 6: Linear Algebra This lab is aimed at demonstrating Python s ability to solve linear algebra problems. At the end of the assignment, you should be able to write code that sets up

More information

Linear Algebra Using MATLAB

Linear Algebra Using MATLAB Linear Algebra Using MATLAB MATH 5331 1 May 12, 2010 1 Selected material from the text Linear Algebra and Differential Equations Using MATLAB by Martin Golubitsky and Michael Dellnitz Contents 1 Preliminaries

More information

2 Solving Ordinary Differential Equations Using MATLAB

2 Solving Ordinary Differential Equations Using MATLAB Penn State Erie, The Behrend College School of Engineering E E 383 Signals and Control Lab Spring 2008 Lab 3 System Responses January 31, 2008 Due: February 7, 2008 Number of Lab Periods: 1 1 Objective

More information

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017 Assigned: March 20, 2017 Due Date: Week of April 03, 2017 George Mason University ECE 201: Introduction to Signal Analysis Spring 2017 Laboratory Project #6 Due Date Your lab report must be submitted on

More information

Linear Equations & Inequalities Definitions

Linear Equations & Inequalities Definitions Linear Equations & Inequalities Definitions Constants - a term that is only a number Example: 3; -6; -10.5 Coefficients - the number in front of a term Example: -3x 2, -3 is the coefficient Variable -

More information

STATE VARIABLE (SV) SYSTEMS

STATE VARIABLE (SV) SYSTEMS Copyright F.L. Lewis 999 All rights reserved Updated:Tuesday, August 05, 008 STATE VARIABLE (SV) SYSTEMS A natural description for dynamical systems is the nonlinear state-space or state variable (SV)

More information

Note to the Presenter

Note to the Presenter Note to the Presenter Print the notes of the power point (File Print select print notes) to have as you present the slide show. There are detailed notes for the presenter that go with each slide. Investigating

More information

9. Introduction and Chapter Objectives

9. Introduction and Chapter Objectives Real Analog - Circuits 1 Chapter 9: Introduction to State Variable Models 9. Introduction and Chapter Objectives In our analysis approach of dynamic systems so far, we have defined variables which describe

More information

State Feedback Controller for Position Control of a Flexible Link

State Feedback Controller for Position Control of a Flexible Link Laboratory 12 Control Systems Laboratory ECE3557 Laboratory 12 State Feedback Controller for Position Control of a Flexible Link 12.1 Objective The objective of this laboratory is to design a full state

More information

Chapter. Algebra techniques. Syllabus Content A Basic Mathematics 10% Basic algebraic techniques and the solution of equations.

Chapter. Algebra techniques. Syllabus Content A Basic Mathematics 10% Basic algebraic techniques and the solution of equations. Chapter 2 Algebra techniques Syllabus Content A Basic Mathematics 10% Basic algebraic techniques and the solution of equations. Page 1 2.1 What is algebra? In order to extend the usefulness of mathematical

More information

EGR 140 Lab 6: Functions and Function Files Topics to be covered : Practice :

EGR 140 Lab 6: Functions and Function Files Topics to be covered : Practice : EGR 140 Lab 6: Functions and Function Files Topics to be covered : Creating a Function File Structure of a Function File Function Definition Line Input and Output Arguments Function Body Local and Global

More information

MAT 343 Laboratory 3 The LU factorization

MAT 343 Laboratory 3 The LU factorization In this laboratory session we will learn how to MAT 343 Laboratory 3 The LU factorization 1. Find the LU factorization of a matrix using elementary matrices 2. Use the MATLAB command lu to find the LU

More information

MAT 275 Laboratory 6 Forced Equations and Resonance

MAT 275 Laboratory 6 Forced Equations and Resonance MAT 275 Laboratory 6 Forced Equations and Resonance In this laboratory we take a deeper look at second-order nonhomogeneous equations. We will concentrate on equations with a periodic harmonic forcing

More information

MA 123 September 8, 2016

MA 123 September 8, 2016 Instantaneous velocity and its Today we first revisit the notion of instantaneous velocity, and then we discuss how we use its to compute it. Learning Catalytics session: We start with a question about

More information

Programs for Natural Cubic Spline Interpolation

Programs for Natural Cubic Spline Interpolation Outlines November 2, 2004 Outlines Part I: The Basics The Basic Method The Data Part I The Basic Method The Data Review of Natural Cubic Spline Method Given a series of points (x 0, f (x 0 )) (x n, f (x

More information

Numerical integration

Numerical integration Numerical integration Responsible teacher: Anatoliy Malyarenko November 8, 003 Contents of the lecture: Black Scholes model. The trapezoidal rule. Simpson s rule. Error handling in MATLAB. Error analysis.

More information