matlabtutorial - Massachusetts Institute of Technology...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Massachusetts Institute of Technology Department of Electrical Engineering & Computer Science 6.345/HST.728 Automatic Speech Recognition Spring, 2007 Issued: 2/7/07 Introduction to matlab Introduction matlab , which stands for Matrix Laboratory, is a commercial interactive package from Mathworks ( ) used for data analysis and visual- ization. One main issue to keep in mind is that matlab is best at manipulating vectors and matrices. Take advantage of this idea when formulating your problem for matlab coding. To be able to run matlab on the CSAIL machines, make sure that you have a .software file in your local directory with one of its line being: matlab This will automatically put the latest matlab version in your path. You have to log in again for the change to go into effect. To start matlab , type: % matlab Once the desktop is started, type: >> help at the matlab prompt for information on various toolboxes. If you want to learn more about command , type: >> help command If you are not sure what the name of the command is but have a keyword you want to try, type: >> lookfor keyword To quit matlab , type: >> quit or >> exit Vectors and Matrices To define a row vector in matlab type: >> v_row = [e1 e2 e3 e4 ... ]; 1 Removing the semi-colon will display the contents of v row. This is one way to track the values of your variables while debugging. To define a column vector type: >> v_column = [e1; e2; e3; e4 ]; To access an element of v_column , type: >> v_column ( index ) Note that the first element in matlab vectors has index 1. An example of a 3x3 matrix is: >> M = [e11 e12 e13; e21 e22 e23; e13 e23 e33]; The ; indicates vertical concatenation. To access an element of M , type: >> M ( row index,column index ) Elementary vectors and matrices The function ones allows you to define a matrix of any dimension with all elements set to one. For example,set to one....
View Full Document

Page1 / 5

matlabtutorial - Massachusetts Institute of Technology...

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

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