Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab1 (Signal & System) Instructor: Anan Osothsilp Date: 30 Jan 07.

Similar presentations


Presentation on theme: "Lab1 (Signal & System) Instructor: Anan Osothsilp Date: 30 Jan 07."— Presentation transcript:

1 Lab1 (Signal & System) Instructor: Anan Osothsilp Date: 30 Jan 07

2 Anan OsothsilpPage 1 Lab1 Date: 30 Jan 07 Objective: Introduce the working environment of Matlab program Learn how to work with Matlab command window Learn basic variable assignment, variable type, and built-in function Learn how to solve simple equation Learn how to plot primitive graph

3 Anan OsothsilpPage 2 Lab1 Date: 30 Jan 07 Lab Instruction: Follow the video tutorial and do Lab exercisesFollow the video tutorial

4 Anan OsothsilpPage 3 Lab1 Date: 30 Jan 07 Useful command clc : clear screen clear : clear variables in the workspace memory syms: create symbolic variable help: pop up help information for query command plot: plot graph subplot: generate subplot for multiple axis

5 Anan OsothsilpPage 4 Lab1 Date: 30 Jan 07 Basic arithmetic operation Arithmetic operations with scalars: The symbols of arithmetic operations are: OperationSymbolExample Addition+9+3 Subtraction-9-3 Multiplication*9*3 Right division/9/3 Left division\9\3 or 3/9 Exponentiation^9^3(means 9=243) Order of precedence: PrecedenceMathematical Operation FirstParentheses. For nested parameters, the innermost are executed first. SecondExponentiation. ThirdMultiplication, division (equal precedence). FourthAddition and subtraction.

6 Anan OsothsilpPage 5 Lab1 Date: 30 Jan 07 Basic built-in Mathematic function FunctionDescriptionExample sqrt(x)Square rootsqrt(25)=5 exp(x)Exponential (e )exp(5)=148.4132 abs(x)Absolute valueabs(-21)=21 log(x)Natural logarithmlog(1000)=6.9078 log10(x)Base 10 logarithmlLog10(1000)=3 factorialThe factorial functionfactorial(5)=120

7 Anan OsothsilpPage 6 Lab1 Date: 30 Jan 07 Exercise 1: write Matlab script to calculate following expressions x+5x-21.2xy+12y-23 1. 2. 3. 4.

8 Anan OsothsilpPage 7 Lab1 Date: 30 Jan 07 Exercise 2: write Matlab script to plot graph for following data t = [0,1,2,3,4,5,6,7,8,9,10] Y1 = 3*t t = 0:1:10 Y2 = t^2 +1 Plot Y1 versus t Plot Y2 versus t Plot Y1 & Y2 versus t on the same figure 1 2 3

9 Anan OsothsilpPage 8 Lab1 Date: 30 Jan 07 Exercise 2: write Matlab script to plot graph for following data Plot Y1 & Y2 versus t on separate axis but on the same figure Axis 1 Axis 2 3


Download ppt "Lab1 (Signal & System) Instructor: Anan Osothsilp Date: 30 Jan 07."

Similar presentations


Ads by Google