113_1_Matlab tutorial (week 1)

113_1_Matlab tutorial (week 1) - Matlab GUI EE 113 Digital...

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

View Full Document Right Arrow Icon
EE 113 – Digital Signal Processing MATLAB Tutorial Teaching Assistants: Spring Quarter 2008 – Week 1 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 Command window Enter and execute commands line-by-line Function help/documentation: help or doc 3
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 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 ±unctions Many built-in functions: sin(x), cos(y), sqrt(z), atan(u), .... Make your own functions using m-±les: function y = myFunc(x) Toolboxes (e.g. signal processing toolbox) 6 Essential commands/Functions Resetting environment Remove all variables from workspace: clear Close current/all open ±gure 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 2
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:
Background image of page 3

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

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

This note was uploaded on 02/09/2011 for the course EE 113 taught by Professor Walker during the Spring '08 term at UCLA.

Page1 / 6

113_1_Matlab tutorial (week 1) - Matlab GUI EE 113 Digital...

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

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