113_1_ee113 matlab tutorial

113_1_ee113 matlab tutorial - EE 113: Digital Signal...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
EE 113: Digital Signal Processing Matlab Tutorial Teaching Assistants: Nick Mastronarde, Yu Zhang, Shaolei Ren Spring 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Where to use Matlab • Computer labs http://www.seasnet.ucla.edu/classes/seasnet-computer-labs • Obtain Matlab License – UCLA Store: Matlab Student Edition ($99) – Signal Processing Toolbox ($59)
Background image of page 2
Matlab GUI 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Command window Enter and execute commands line-by-line Function help/documentation: help or doc 3
Background image of page 4
Matlab scripts: m-fles Adding a semicolon at the end of a line will cause Matlab to suppress any output in the command window. 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Working with m-fles Comments begin with % , cells begin with %% Evaluate current cell: Ctrl + Enter Evaluate current cell and advance: Ctrl Shift + Enter Run entire script: F5 Evaluate selection: F9 5
Background image of page 6
Basic operators Add, subtract, multiply, divide: a+b, a-b, a*b, a/b Power: 2^3 ans = 8 Elementwise operator: a.*b, a./b, a.^b Greater than, less than, equal, not equal: a>b, a<b, a==b, a~=b Functions Many built-in functions: sin(x), cos(y), sqrt(z), atan(u), .... Make your own functions using m-Fles: function y = myFunc(x) Toolboxes (e.g. signal processing toolbox) 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Essential commands/functions Resetting environment Remove all variables from workspace: clear Close current/all open Fgure windows: close , close all Clear command window: clc Creating variables Scalar: a = 1.2 Row vector: r = [1,2,3] (commas can be omitted) Column vector: c = [1;2;3] Matrix: A = [1 2; 3 4] creates a matrix A = b 1 2 3 4 B 7
Background image of page 8
Essential commands/functions (cont.) Creating variables Vector u = (1 , 2 , . . . , 6) : u = 1:6 Vector v = (1 , 1 . 1 , . . . , 1 . 9 , 2 . 0) : v = 1:0.1:2 Column vector of ones: e = ones(7,1) Matrix of zeros:
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 23

113_1_ee113 matlab tutorial - EE 113: Digital Signal...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online