113_1_matlab_tutorial

# 113_1_matlab_tutoria - EE113 Digital Signal Processing MATLAB Tutorial Teaching Assistants Zhichu Lin and Nick Mastronarde Spring 2009 Week 1 Where

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

EE113: Digital Signal Processing MATLAB Tutorial Teaching Assistants: Zhichu Lin and Nick Mastronarde Spring 2009: Week 1

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

View Full Document
Where to use Matlab Computer Labs SEASnet Labs http://www.seas.ucla.edu/seasnet/ EElab in 53-125 E-IV ? Obtain a Matlab license UCLA Store: Matlab Student Edition (\$99) Signal Processing Toolbox (\$59) 1
Matlab GUI 2

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

View Full Document
Command window Enter and execute commands line-by-line Function help/documentation: help or doc 3
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

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

View Full Document
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
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

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

View Full Document
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
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)

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/26/2010 for the course EE 113 taught by Professor Walker during the Winter '08 term at UCLA.

### Page1 / 23

113_1_matlab_tutoria - EE113 Digital Signal Processing MATLAB Tutorial Teaching Assistants Zhichu Lin and Nick Mastronarde Spring 2009 Week 1 Where

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

View Full Document
Ask a homework question - tutors are online