Matlab is a tool to make our life easier. Keep that in mind. The best way to learn Matlab is through examples, at the computer.

Size: px
Start display at page:

Download "Matlab is a tool to make our life easier. Keep that in mind. The best way to learn Matlab is through examples, at the computer."

Transcription

1 Learn by doing! The purpose of this tutorial is to provide an introduction to Matlab, a powerful software package that performs numeric computations. The examples should be run as the tutorial is followed. A basic understanding of matrix algebra is assumed. Please consult a linear algebra text if necessary. Matlab is a tool to make our life easier. Keep that in mind. The best way to learn Matlab is through examples, at the computer. At startup Matlab opens several windows. You can customize the space and decide which windows to keep open. However, you will use mostly Editor window - to write m-files; Command window to type command wait for the prompt sign >>. You can start MATLAB by double clicking on the MATLAB icon that should be on the desktop of your computer. This brings up the window called the Command Window. This window allows a user to enter simple commands. To clear the Command Window type clc and next press the Enter key. To perform a simple computations type a command and next press the Enter key. For instance, >>s = s = 3 >>fun = sin(pi/4) fun = note: in this examples bold is what you type In the second example the trigonometric function sine and the constant π are used. In MATLAB they are named sin and pi, respectively. Note that the results of these computations are saved in variables whose names are chosen by the user. If they will be needed during your current MATLAB session, then you can obtain their values typing their names and pressing the Enter key. For instance, >>s s = 3 Variable name begins with a letter, followed by letters, numbers or underscores. MATLAB recognizes only the first 31 characters of a variable name. MATLAB statements are normally of the form: variable = expression ECE 140 MATLAB TUTORIAL Page 1

2 Expressions typed by the user are interpreted and immediately evaluated by the MATLAB system. If a MATLAB statement ends with a semicolon, MATLAB evaluates the statement but suppresses the display of the results. A matrix may be entered as follows: A = [1 2 3; 2 3 4; 3 4 5]; Note that the matrix entries must be surrounded by brackets [ ] with row elements separated by blanks or by commas. The end of each row, with the exception of the last row, is indicated by a semicolon. A matrix A can also be entered across three input lines as A = [ ]; In this case, the carriage returns replace the semicolons. A row vector B with five elements B = [ ] can be entered in MATLAB as B = [ ]; or B = [6,9,12,15,18] For readability, it is better to use spaces rather than commas between the elements. The row vector B can be turned into a column vector by transposition, which is obtained by typing C = B The above results in C = ECE 140 MATLAB TUTORIAL Page 2

3 Other ways of entering the column vector C are C = [ ] or C = [6;9;12;15;18] MATLAB is case sensitive in naming variables, commands and functions. Thus b and B are not the same variable. If you do not want MATLAB to be case sensitive, you can use the command casesen off. To obtain the size of a specific variable, type size(). For example, to find the size of matrix A, you can execute the following command: size(a) will yield ans = 3 3 The result will be a row vector with two entries. The first is the number of rows in A, the second the number of columns in A. HELP!!! One of the nice features of MATLAB is its help system. To learn more about a function you are to use, say svd, type in the Command Window >>help soundsc SOUNDSC Autoscale and play vector as sound. SOUNDSC(Y,...) is the same as SOUND(Y,...) except the data is scaled so that the sound is played as loud as possible without clipping. The mean of the dynamic range of the data is set to zero after the normalization. SOUNDSC(Y,...,SLIM) where SLIM = [SLOW SHIGH] linearly scales values in Y in the range [SLOW, SHIGH] to [-1, 1]. Values outside this range are not clipped. By default, SLIM is ECE 140 MATLAB TUTORIAL Page 3

4 [MIN(Y) MAX(Y)]. See also sound, wavplay, wavrecord. Reference page in Help browser doc soundsc If you do not remember the exact name of a function you want to learn more about use command lookfor followed by the incomplete name of a function in the Command Window. In the following example we use a "word" sv >>lookfor sound spectralanalysis1.m: %soundfile = eval(get(soundfilename,'string')); % gets the sound file name tony_sep.m: % READSOUNDS looks in a directory "sounds/" for sound files and use_phase_change.m: %sound mixture MagPhaSpecPlot.m: % Program to compute spectrogram of sound file and plot its magnitude and phase MagPhaSpecPlot2.m: % Program to compute spectrogram of sound file and plot its magnitude and phase BEEP Produce beep sound. SOUNDVIEW View and play sound with replay button AUREAD Read NeXT/SUN (".au") sound file. AUWRITE Write NeXT/SUN (".au") sound file. SOUND Play vector as sound. SOUNDSC Autoscale and play vector as sound. WAVPLAY Play sound using Windows audio output device. WAVREAD Read Microsoft WAVE (".wav") sound file. WAVRECORD Record sound using Windows audio input device. WAVWRITE Write Microsoft WAVE (".wav") sound file. XPSOUND Demonstrate MATLAB's sound capability. MACHNUMBER Compute Mach number using velocity and speed of sound. daqsong.m: %% Generation of Audio Using the Sound Card NNSOUND Turn Neural Network Design sounds on and off. PLAYSND Implementation for SOUND The helpwin command, invoked without arguments, opens a new window on the screen. To find information you need double click on the name of the subdirectory and next double click on a function to see the help text for that function. You can go directly to the help text of your function invoking helpwin command followed by an argument. For instance, executing the following command >>helpwin zeros ZEROS Zeros array. ZEROS(N) is an N-by-N matrix of zeros. ZEROS(M,N) or ZEROS([M,N]) is an M-by-N matrix of zeros. ZEROS(M,N,P,...) or ZEROS([M N P...]) is an M-by-N-by-P-by-... array of zeros. ECE 140 MATLAB TUTORIAL Page 4

5 ZEROS(SIZE(A)) is the same size as A and all zeros. See also ONES. generates an information about MATLAB's function zeros. MATLAB also provides the browser-based help. In order to access these help files click on Help in the main menu. To learn more about MATLAB capabilities you can execute the demo command in the Command Window or click on Help and next select Examples and Demos from the pull-down menu. Some of the MATLAB demos use both the Command and the Figure windows. All variables used in the current MATLAB session are saved in the Workspace. You can view the content of the Workspace by clicking on File in the toolbar and next selecting Show Workspace from the pull-down menu. You can also check contents of the Workspace typing whos in the Command Window. For instance, >>whos Name Size Bytes Class ans 1x1 16 double array (complex) fun 1x1 8 double array ld 1x1 8 double array rd 1x1 8 double array s 1x1 8 double array xi 1x1 8 double array xr 1x1 8 double array Grand total is 7 elements using 64 bytes shows all variables used in current session. You can also use command who to generate a list of variables used in current session >>who Your variables are: ans ld s xr fun rd xi To save your current workspace select Save Workspace as from the File menu. Chose a name for your file, e.g. filename.mat and next click on Save. Remember that the file you just created must be located in MATLAB's search path. Another way of saving your workspace is to type save filename in the Command Window. The following command save filename s saves only the variable s. Another way to save your workspace is to type the command diary filename in the Command Window. All commands and variables created from now will be saved in our file. The following command: diary off will close the file and save it as the text file. You can open this file in a text editor, by double clicking on the name of your file, and modify its contents if you wish to do so. ECE 140 MATLAB TUTORIAL Page 5

6 To load contents of the file named filename into MATLAB's workspace type load filename in the Command Window. To enter a statement that is too long to be typed in one line, use three periods,, followed by Enter. For instance, >>x = sin(1) - sin(2) + sin(3) - sin(4) + sin(5) -... sin(6) + sin(7) - sin(8) + sin(9) - sin(10) x = You can suppress output to the screen by adding a semicolon after the statement >>u = 2 + 3; Some Command Description % Comments: Everything appearing on the same line after % is not executed. clear clc clg length Matrix Operations Clears the variables or functions from the workspace Clears the command window during a session Clears the variables or functions from workspace Length of a matrix The basic matrix operations are addition (+), subtraction (-), multiplication (*), and conjugate transpose ( ) of matrices, and exponentiation ( ^). In addition to the above basic operations, MATLAB has two forms of matrix division: the left inverse operator \ or the right inverse operator /. Matrices of the same dimension may be subtracted or added. Thus if E and F are entered in MATLAB as >>E = [7 2 3;4 3 6;8 1 5]; >>F = [1 4 2;6 7 5;1 9 1]; and >>G = E F >>H = E + F then, matrices G and H will appear on the screen as G = ECE 140 MATLAB TUTORIAL Page 6

7 H = A scalar (1-by-1 matrix) may be added to or subtracted from a matrix. In this particular case, the scalar is added to or subtracted from all the elements of another matrix. For example, >>J = H + 1 gives J = Matrix multiplication is defined provided the inner dimensions of the two operands are the same. Thus if X is an n-by-m matrix and Y is a i-by-j matrix, X*Y is defined provided m = i. (the number of columns of X equals the number of rows of Y) Since E and F are 3-by-3 matrices, the product >>Q = E*F results in Q = Any matrix can be multiplied by a scalar. For example, >>2*Q gives ans = Note that if a variable name and the = sign are omitted, a variable name ans is automatically created. Matrix division can be the left division operator \ or the right division operator /. The right division a/b, for instance, is algebraically equivalent to, while the left division a\b is equivalent to. ECE 140 MATLAB TUTORIAL Page 7

8 If Z * I = V and Z is non-singular, then left division, Z\V is equivalent to the MATLAB expression I = inv(z)*v where inv is the MATLAB expression function for obtaining the inverse of a matrix. The right division denoted by V/Z is equivalent to the MATLAB expression I = V*inv(Z) There are MATLAB functions that can be used to produce special matrices. Examples are given in the following table. Function ones(n,m) eye(n) zeros(n,m) diag(a) Description Produces n-by-m matrix with all the elements being unity Gives n-by-n identity matrix Produces n-by-m matrix of zeros Produce a vector consisting of the elements on the diagonal of a square matrix A Array Operations Array operations refer to element-by-element arithmetic operations. Preceding the linear algebraic operations, * / \, by a period (.) indicates an array or element-by-element operation. Thus, the operators.*,.\,./,.^ represent element-by-element multiplication, left division, right division, and raising to the power, respectively. For addition and subtraction, the array and matrix operations are the same. Thus, + and.+ can be regarded as an array or matrix addition. If A1 and B1 are matrices of the same dimension, then A1.* B1 denotes an array whose elements are products of the corresponding elements of A1 and B1. Thus if, A1 = [ ]; B1 = [ ]; then C1 = A1.*B1 results in C1 = An array operation for left and right division also involves element-by-element operation. The expressions A1.\B1 give the quotient of element-by-element division of matrices A1 and B1. The statement D1 = A1./B1 gives the result ECE 140 MATLAB TUTORIAL Page 8

9 D1 = The array operation of raising to the power is denoted by.^. The general statement will be of the form: q = r1.^s1 If r1 and s1 are matrices of the same dimensions, then the result q is also a matrix of the same dimension. For example, if r1 = [7 3 5]; s1 = [2 4 3]; then q1 = r1.^s1 gives the result q1 = One of the operands can be scalar. For example, q2 = r1.^2 q3 = 2.^s1 will give q2 = q3 = Note that when one of the operands is a scalar, the resulting matrix will have the same dimensions as the matrix operand. Complex Numbers MATLAB allows operations involving complex numbers. Complex numbers are entered using function i or j. For example, a number z = 2 + j2 may be entered in MATLAB as z = 2+2*i or z = 2+2*j Also, a complex number can be entered in MATLAB as za = 2*sqrt(2)*exp((pi/4)*j) ECE 140 MATLAB TUTORIAL Page 9

10 It should be noted that when complex numbers are entered as matrix elements within brackets, one should avoid any blank spaces. For example, y = 3 + j4 is represented in MATLAB as y = 3+4*j If spaces exist around the + sign, such as u = 3 + 4*j MATLAB considers it as two separate numbers. If complex matrix is given as then we can represent it in MATLAB as w = [1+j 2-2*j; 3+2*j 4+3*j] which will produce the result w = i i i i If the entries in a matrix are complex, then the prime ( ) operator produces the conjugate transpose. Thus wp = w will produce wp = i i i i For the unconjugate transpose of a complex matrix, we can use the point transpose (. ) command. For example, wt = w. will yield wt = i i i i The imaginary unit is denoted either by i or j >>j ans = i ECE 140 MATLAB TUTORIAL Page 10

11 There are three kinds of numbers used in MATLAB: integers real numbers complex numbers In addition to classes of numbers mentioned above, MATLAB has three variables representing the nonnumbers: -Inf Inf NaN The Inf and Inf are the IEEE representations for the negative and positive infinity, respectively. Infinity is generated by overflow or by the operation of dividing by zero. The NaN stands for the not-a-number and is obtained as a result of the mathematically undefined operations such as 0.0/0.0 or. The Colon Symbol (:) The colon symbol (:) is one of the most important operators in MATLAB. It can be used (1) to create vectors and matrices, (2) to specify sub-matrices and vectors, and (3) to perform iterations. The statement t1 = 1:6 will generate a row vector containing the numbers from 1 to 6 with unit increment. MATLAB produces the result t1 = Non-unity (positive or negative) increments may be specified. For example, the statement t2 = 3:-0.5:1 will result in t2 = The statement t3 = [(0:2:10);(5:-0.2:4)] will result in a 2-by-4 matrix t3 = ECE 140 MATLAB TUTORIAL Page 11

12 Other MATLAB functions for generating vectors are linspace and logspace. Linspace generates linearly evenly spaced vectors, while logspace generates logarithmically evenly spaced vectors. The usage of these functions is of the form: linspace (i_value, f_value, np) logspace (i_value, f_value, np) where i_value is the initial value, f_value is the final value, and np is the total number of elements in the vector. For example, t4 = linspace (2,6,8) will generate the vector t4 = Columns 1 through Columns 4 through Individual elements in a matrix can be referenced with subscripts inside parentheses. For example, t2(4) is the fourth element of vector t2. Also, for matrix t3, t3(2,3) denotes the entry in the second row and third column. Using the colon as one of the subscripts denotes all of the corresponding row or column. For example, t3(:,4) is the fourth column of matrix t3. Thus, the statement t5 = t3(:,4) will give t5 = Also, the statement t3(2,:) is the second row of matrix t3. That is the statement t6 = t3(2,:) will result in t6 = If the colon exists as the only subscript, such as t3(:), the latter denotes the elements of matrix t3 strung out in a long column vector. Thus the statement t7 = ECE 140 MATLAB TUTORIAL Page 12

13 Graphing Signals In MATLAB both plot and stem can be used to plot a signal. In general, stem is used to plot short discrete-time signals, and plot is better suited for sampled approximations of continuous-time signals or for very long discrete-time signals. The difference between these functions can be seen by typing the following example: n1 = [-5:5]; n2 = [-5:0.1:5]; x1 = n1 >= -2 & n1 < 2; x2 = sin(n2); figure subplot(211), stem(n1,x1), subplot(212), plot(n2,x2) Example that we are going to use again! a bit later Sinusiodal signal x(t), whose frequency is 20Hz, is sampled at a sampling rate R = 1000Hz. Generate a Matlab program to plot signal x vs time. Solution R = 1000 Hz; %sampling rate in Hz t = 0:1/R:2; %chosen max time 2 seconds x = sin(2*pi*f.*t); figure, plot(t,x) M-Files and Scripts ECE 140 MATLAB TUTORIAL Page 13

14 More advanced computations often require execution of several lines of computer code. Rather than typing those commands in the Command Window you should create a file. Each time you will need to repeat computations just invoke your file. Another advantage of using files is the ease to modify its contents. Files that contain a computer code are called the m-files. There are two kinds of m-files: the script files and the function files. Both script and function files contain a sequence of commands. However, function files take arguments and return values. To list m-files in the current directory on your disk, you can use the MATLAB command what. The MATLAB command, type, can be used to show the contents of a specified file. Script files To make the m-file click on File next select New and click on M-File from the pull-down menu. You will be presented with the MATLAB Editor/Debugger screen. Here you will type your code, can make changes, etc. Once you are done with typing, click on File, in the MATLAB Editor/Debugger screen and select Save As. Chose a name for your file, e.g., firstgraph.m and click on Save. Make sure that your file is saved in the directory that is in MATLAB's search path. If you have at least two files with duplicated names, then the one that occurs first in MATLAB's search path will be executed. To open the m-file from within the Command Window type edit firstgraph and then press Enter key. You can open the m-file by selecting under the file menu select open file. Choose desired m-file and open it. You should see a new window that has your code in it. To illustrate the use of an m-file, type the following text into the Matlab Editor and save it as firstgraph. % Script file firstgraph. x = pi/100:pi/100:10*pi; y = sin(x)./x; plot(x,y) grid As another exercise, type Example 1 into the m-file text editor and save the m-file. To execute the script, under the debug menu, select run. You can also choose to press F5 (on a PC) to run your script. Verify that the output matches output from Example 1. Statements in a script file operate globally on the workspace data. Normally, when m- files are executing, the commands are not displayed on screen. The MATLAB echo command can be used to view m-files while they are executing. Function Files Function files are m-files that are used to create new MATLAB functions. Variables defined and manipulated inside a function file are local to the function, and they do not ECE 140 MATLAB TUTORIAL Page 14

15 operate globally on the workspace. However, arguments may be passed into and out of a function file. The general form of a function file is: function variable(s) = function_name(arguments) % help text in the usage of the function command lines end To illustrate the usage of function files and rules for writing m-file functions, let us look at an example. Write a function file to generate a sinusoidal sum, for given input frequencies, sampling rate, and desired length in seconds Solution function signal_add = u(f1,f2,r,tmax) % f-input frequncies, R- sampling rate, tmax max duration t = 0:1/R:tMax; signal_add = sin(2*pi*f1*t) + sin(2*pi*f2*t); end Save this m-file as signal_add.m It is very important that you give the function file the same name as the function itself. It is not necessary to compile the function file. Be sure the folder that you saved the function file to is in the same folder as the m-file that calls the function. Now suppose we want to find the sum of two sinusoids whose frequencies are 210 and 200 Hz, sampled at 2000Hz, for 2 seconds. The following statements can by typed in the MATLAB command window to reference the function x = u(210,200,2000,2); To interrupt a running program press simultaneously the Ctrl-c keys. Sometimes you have to repeat pressing these keys a couple of times to halt execution of your program. This is not a recommended way to exit a program, however, in certain circumstances it is a necessity. For instance, a poorly written computer code can put MATLAB in the infinite loop and this would be the only option you will have left. ECE 140 MATLAB TUTORIAL Page 15

Edward Neuman Department of Mathematics Southern Illinois University at Carbondale

Edward Neuman Department of Mathematics Southern Illinois University at Carbondale Edward Neuman Department of Mathematics Southern Illinois University at Carbondale edneuman@siu.edu The purpose of this tutorial is to present basics of MATLAB. We do not assume any prior knowledge of

More information

the Enter or Return key. To perform a simple computations type a command and next press the

the Enter or Return key. To perform a simple computations type a command and next press the Edward Neuman Department of Mathematics Southern Illinois University at Carbondale edneuman@siu.edu The purpose of this tutorial is to present basics of MATLAB. We do not assume any prior knowledge of

More information

2.0 MATLAB Fundamentals

2.0 MATLAB Fundamentals 2.0 MATLAB Fundamentals 2.1 INTRODUCTION MATLAB is a computer program for computing scientific and engineering problems that can be expressed in mathematical form. The name MATLAB stands for MATrix LABoratory,

More information

AN INTRODUCTION TO MATLAB

AN INTRODUCTION TO MATLAB AN INTRODUCTION TO MATLAB 1 Introduction MATLAB is a powerful mathematical tool used for a number of engineering applications such as communication engineering, digital signal processing, control engineering,

More information

Introduction to MATLAB

Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 Software Philosophy Matrix-based numeric computation MATrix LABoratory built-in support for standard matrix and vector operations High-level programming language Programming

More information

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain Introduction to Matlab By: Dr. Maher O. EL-Ghossain Outline: q What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display Facilities Flow Control

More information

Introduction to MATLAB

Introduction to MATLAB ELG 3125 - Lab 1 Introduction to MATLAB TA: Chao Wang (cwang103@site.uottawa.ca) 2008 Fall ELG 3125 Signal and System Analysis P. 1 Do You Speak MATLAB? MATLAB - The Language of Technical Computing ELG

More information

Digital Image Analysis and Processing CPE

Digital Image Analysis and Processing CPE Digital Image Analysis and Processing CPE 0907544 Matlab Tutorial Dr. Iyad Jafar Outline Matlab Environment Matlab as Calculator Common Mathematical Functions Defining Vectors and Arrays Addressing Vectors

More information

Lecturer: Keyvan Dehmamy

Lecturer: Keyvan Dehmamy MATLAB Tutorial Lecturer: Keyvan Dehmamy 1 Topics Introduction Running MATLAB and MATLAB Environment Getting help Variables Vectors, Matrices, and linear Algebra Mathematical Functions and Applications

More information

Introduction to MATLAB for Engineers, Third Edition

Introduction to MATLAB for Engineers, Third Edition PowerPoint to accompany Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 2 Numeric, Cell, and Structure Arrays Copyright 2010. The McGraw-Hill Companies, Inc. This work is

More information

A Guide to Using Some Basic MATLAB Functions

A Guide to Using Some Basic MATLAB Functions A Guide to Using Some Basic MATLAB Functions UNC Charlotte Robert W. Cox This document provides a brief overview of some of the essential MATLAB functionality. More thorough descriptions are available

More information

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP)

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP) Digital Signal Processing Prof. Nizamettin AYDIN naydin@yildiz.edu.tr naydin@ieee.org http://www.yildiz.edu.tr/~naydin Course Details Course Code : 0113620 Course Name: Digital Signal Processing (Sayısal

More information

Introduction to MATLAB 7 for Engineers

Introduction to MATLAB 7 for Engineers PowerPoint to accompany Introduction to MATLAB 7 for Engineers William J. Palm III Chapter 2 Numeric, Cell, and Structure Arrays Copyright 2005. The McGraw-Hill Companies, Inc. Permission required for

More information

Matlab Tutorial. Get familiar with MATLAB by using tutorials and demos found in MATLAB. You can click Start MATLAB Demos to start the help screen.

Matlab Tutorial. Get familiar with MATLAB by using tutorials and demos found in MATLAB. You can click Start MATLAB Demos to start the help screen. University of Illinois at Urbana-Champaign Department of Electrical and Computer Engineering ECE 298JA Fall 2015 Matlab Tutorial 1 Overview The goal of this tutorial is to help you get familiar with MATLAB

More information

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial 1 Matlab Tutorial 2 Lecture Learning Objectives Each student should be able to: Describe the Matlab desktop Explain the basic use of Matlab variables Explain the basic use of Matlab scripts Explain the

More information

EE3TP4: Signals and Systems Lab 1: Introduction to Matlab Tim Davidson Ext Objective. Report. Introduction to Matlab

EE3TP4: Signals and Systems Lab 1: Introduction to Matlab Tim Davidson Ext Objective. Report. Introduction to Matlab EE3TP4: Signals and Systems Lab 1: Introduction to Matlab Tim Davidson Ext. 27352 davidson@mcmaster.ca Objective To help you familiarize yourselves with Matlab as a computation and visualization tool in

More information

A Very Brief Introduction to Matlab

A Very Brief Introduction to Matlab A Very Brief Introduction to Matlab by John MacLaren Walsh, Ph.D. for ECES 63 Fall 26 October 3, 26 Introduction To MATLAB You can type normal mathematical operations into MATLAB as you would in an electronic

More information

Laboratory 1 Octave Tutorial

Laboratory 1 Octave Tutorial Signals, Spectra and Signal Processing Laboratory 1 Octave Tutorial 1.1 Introduction The purpose of this lab 1 is to become familiar with the GNU Octave 2 software environment. 1.2 Octave Review All laboratory

More information

Matlab Introduction. Scalar Variables and Arithmetic Operators

Matlab Introduction. Scalar Variables and Arithmetic Operators Matlab Introduction Matlab is both a powerful computational environment and a programming language that easily handles matrix and complex arithmetic. It is a large software package that has many advanced

More information

Introduction to MATLAB

Introduction to MATLAB 58:110 Computer-Aided Engineering Spring 2005 Introduction to MATLAB Department of Mechanical and industrial engineering January 2005 Topics Introduction Running MATLAB and MATLAB Environment Getting help

More information

ECE Lesson Plan - Class 1 Fall, 2001

ECE Lesson Plan - Class 1 Fall, 2001 ECE 201 - Lesson Plan - Class 1 Fall, 2001 Software Development Philosophy Matrix-based numeric computation - MATrix LABoratory High-level programming language - Programming data type specification not

More information

Introduction to MATLAB LAB 1

Introduction to MATLAB LAB 1 Introduction to MATLAB LAB 1 1 Basics of MATLAB MATrix LABoratory A super-powerful graphing calculator Matrix based numeric computation Embedded Functions Also a programming language User defined functions

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 1 Chapter 2 MATLAB Fundamentals PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB 1 Introduction to MATLAB A Tutorial for the Course Computational Intelligence http://www.igi.tugraz.at/lehre/ci Stefan Häusler Institute for Theoretical Computer Science Inffeldgasse

More information

Creates a 1 X 1 matrix (scalar) with a value of 1 in the column 1, row 1 position and prints the matrix aaa in the command window.

Creates a 1 X 1 matrix (scalar) with a value of 1 in the column 1, row 1 position and prints the matrix aaa in the command window. EE 350L: Signals and Transforms Lab Spring 2007 Lab #1 - Introduction to MATLAB Lab Handout Matlab Software: Matlab will be the analytical tool used in the signals lab. The laboratory has network licenses

More information

EGR 111 Introduction to MATLAB

EGR 111 Introduction to MATLAB EGR 111 Introduction to MATLAB This lab introduces the MATLAB help facility, shows how MATLAB TM, which stands for MATrix LABoratory, can be used as an advanced calculator. This lab also introduces assignment

More information

Outline. CSE 1570 Interacting with MATLAB. Outline. Starting MATLAB. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Outline. CSE 1570 Interacting with MATLAB. Outline. Starting MATLAB. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An. CSE 10 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

Introduction to MATLAB

Introduction to MATLAB CHEE MATLAB Tutorial Introduction to MATLAB Introduction In this tutorial, you will learn how to enter matrices and perform some matrix operations using MATLAB. MATLAB is an interactive program for numerical

More information

MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB

MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB In this laboratory session we will learn how to 1. Create matrices and vectors. 2. Manipulate matrices and create matrices of special types

More information

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline MATLAB Tutorial EE351M DSP Created: Thursday Jan 25, 2007 Rayyan Jaber Modified by: Kitaek Bae Outline Part I: Introduction and Overview Part II: Matrix manipulations and common functions Part III: Plots

More information

MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB

MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB MATLAB is a computer software commonly used in both education and industry to solve a wide range of problems. This Laboratory provides a brief

More information

MATLAB/Octave Tutorial

MATLAB/Octave Tutorial University of Illinois at Urbana-Champaign Department of Electrical and Computer Engineering ECE 298JA Fall 2017 MATLAB/Octave Tutorial 1 Overview The goal of this tutorial is to help you get familiar

More information

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An. CSE 170 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

Finding, Starting and Using Matlab

Finding, Starting and Using Matlab Variables and Arrays Finding, Starting and Using Matlab CSC March 6 &, 9 Array: A collection of data values organized into rows and columns, and known by a single name. arr(,) Row Row Row Row 4 Col Col

More information

Chapter 1 Introduction to MATLAB

Chapter 1 Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 What is MATLAB? MATLAB = MATrix LABoratory, the language of technical computing, modeling and simulation, data analysis and processing, visualization and graphics,

More information

LAB 1: Introduction to MATLAB Summer 2011

LAB 1: Introduction to MATLAB Summer 2011 University of Illinois at Urbana-Champaign Department of Electrical and Computer Engineering ECE 311: Digital Signal Processing Lab Chandra Radhakrishnan Peter Kairouz LAB 1: Introduction to MATLAB Summer

More information

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors.

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors. 1 LECTURE 3 OUTLINES Variable names in MATLAB Examples Matrices, Vectors and Scalar Scalar Vectors Entering a vector Colon operator ( : ) Mathematical operations on vectors examples 2 VARIABLE NAMES IN

More information

Chapter 2. MATLAB Fundamentals

Chapter 2. MATLAB Fundamentals Chapter 2. MATLAB Fundamentals Choi Hae Jin Chapter Objectives q Learning how real and complex numbers are assigned to variables. q Learning how vectors and matrices are assigned values using simple assignment,

More information

Introduction to MATLAB

Introduction to MATLAB to MATLAB Spring 2019 to MATLAB Spring 2019 1 / 39 The Basics What is MATLAB? MATLAB Short for Matrix Laboratory matrix data structures are at the heart of programming in MATLAB We will consider arrays

More information

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis Introduction to Matlab 1 Outline What is Matlab? Matlab desktop & interface Scalar variables Vectors and matrices Exercise 1 Booleans Control structures File organization User defined functions Exercise

More information

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline (Cont d) MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline (Cont d) MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An CSE 170 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

How to learn MATLAB? Some predefined variables

How to learn MATLAB? Some predefined variables ECE-S352 Lab 1 MATLAB Tutorial How to learn MATLAB? 1. MATLAB comes with good tutorial and detailed documents. a) Select MATLAB help from the MATLAB Help menu to open the help window. Follow MATLAB s Getting

More information

Introduction to MATLAB Programming

Introduction to MATLAB Programming Introduction to MATLAB Programming Arun A. Balakrishnan Asst. Professor Dept. of AE&I, RSET Overview 1 Overview 2 Introduction 3 Getting Started 4 Basics of Programming Overview 1 Overview 2 Introduction

More information

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) Introduction ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) MATLAB is a powerful mathematical language that is used in most engineering companies today. Its strength lies

More information

MATLAB Project: Getting Started with MATLAB

MATLAB Project: Getting Started with MATLAB Name Purpose: To learn to create matrices and use various MATLAB commands for reference later MATLAB built-in functions used: [ ] : ; + - * ^, size, help, format, eye, zeros, ones, diag, rand, round, cos,

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab By:Mohammad Sadeghi *Dr. Sajid Gul Khawaja Slides has been used partially to prepare this presentation Outline: What is Matlab? Matlab Screen Basic functions Variables, matrix, indexing

More information

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013 Lab of COMP 406 MATLAB: Quick Start Lab tutor : Gene Yu Zhao Mailbox: csyuzhao@comp.polyu.edu.hk or genexinvivian@gmail.com Lab 1: 11th Sep, 2013 1 Where is Matlab? Find the Matlab under the folder 1.

More information

University of Alberta

University of Alberta A Brief Introduction to MATLAB University of Alberta M.G. Lipsett 2008 MATLAB is an interactive program for numerical computation and data visualization, used extensively by engineers for analysis of systems.

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 2 Basic MATLAB Operation Dr Richard Greenaway 2 Basic MATLAB Operation 2.1 Overview 2.1.1 The Command Line In this Workshop you will learn how

More information

1 Introduction to Matlab

1 Introduction to Matlab 1 Introduction to Matlab 1. What is Matlab? Matlab is a computer program designed to do mathematics. You might think of it as a super-calculator. That is, once Matlab has been started, you can enter computations,

More information

1 Overview of the standard Matlab syntax

1 Overview of the standard Matlab syntax 1 Overview of the standard Matlab syntax Matlab is based on computations with matrices. All variables are matrices. Matrices are indexed from 1 (and NOT from 0 as in C!). Avoid using variable names i and

More information

Getting started with MATLAB

Getting started with MATLAB Sapienza University of Rome Department of economics and law Advanced Monetary Theory and Policy EPOS 2013/14 Getting started with MATLAB Giovanni Di Bartolomeo giovanni.dibartolomeo@uniroma1.it Outline

More information

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu 0. What is MATLAB? 1 MATLAB stands for matrix laboratory and is one of the most popular software for numerical computation. MATLAB s basic

More information

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab MATH 495.3 (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab Below is a screen similar to what you should see when you open Matlab. The command window is the large box to the right containing the

More information

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT PROGRAMMING WITH MATLAB DR. AHMET AKBULUT OVERVIEW WEEK 1 What is MATLAB? A powerful software tool: Scientific and engineering computations Signal processing Data analysis and visualization Physical system

More information

6.094 Introduction to MATLAB January (IAP) 2009

6.094 Introduction to MATLAB January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.094 Introduction to MATLAB January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.094 Introduction

More information

Part #1. A0B17MTB Matlab. Miloslav Čapek Filip Kozák, Viktor Adler, Pavel Valtr

Part #1. A0B17MTB Matlab. Miloslav Čapek Filip Kozák, Viktor Adler, Pavel Valtr A0B17MTB Matlab Part #1 Miloslav Čapek miloslav.capek@fel.cvut.cz Filip Kozák, Viktor Adler, Pavel Valtr Department of Electromagnetic Field B2-626, Prague You will learn Scalars, vectors, matrices (class

More information

MATLAB Fundamentals. Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University

MATLAB Fundamentals. Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University MATLAB Fundamentals Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University Reference: 1. Applied Numerical Methods with MATLAB for Engineers, Chapter 2 &

More information

FreeMat Tutorial. 3x + 4y 2z = 5 2x 5y + z = 8 x x + 3y = -1 xx

FreeMat Tutorial. 3x + 4y 2z = 5 2x 5y + z = 8 x x + 3y = -1 xx 1 of 9 FreeMat Tutorial FreeMat is a general purpose matrix calculator. It allows you to enter matrices and then perform operations on them in the same way you would write the operations on paper. This

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Introduction MATLAB is an interactive package for numerical analysis, matrix computation, control system design, and linear system analysis and design available on most CAEN platforms

More information

McTutorial: A MATLAB Tutorial

McTutorial: A MATLAB Tutorial McGill University School of Computer Science Sable Research Group McTutorial: A MATLAB Tutorial Lei Lopez Last updated: August 2014 w w w. s a b l e. m c g i l l. c a Contents 1 MATLAB BASICS 3 1.1 MATLAB

More information

Introduction to Engineering gii

Introduction to Engineering gii 25.108 Introduction to Engineering gii Dr. Jay Weitzen Lecture Notes I: Introduction to Matlab from Gilat Book MATLAB - Lecture # 1 Starting with MATLAB / Chapter 1 Topics Covered: 1. Introduction. 2.

More information

MATLAB COURSE FALL 2004 SESSION 1 GETTING STARTED. Christian Daude 1

MATLAB COURSE FALL 2004 SESSION 1 GETTING STARTED. Christian Daude 1 MATLAB COURSE FALL 2004 SESSION 1 GETTING STARTED Christian Daude 1 Introduction MATLAB is a software package designed to handle a broad range of mathematical needs one may encounter when doing scientific

More information

Experiment 1: Introduction to MATLAB I. Introduction. 1.1 Objectives and Expectations: 1.2 What is MATLAB?

Experiment 1: Introduction to MATLAB I. Introduction. 1.1 Objectives and Expectations: 1.2 What is MATLAB? Experiment 1: Introduction to MATLAB I Introduction MATLAB, which stands for Matrix Laboratory, is a very powerful program for performing numerical and symbolic calculations, and is widely used in science

More information

To start using Matlab, you only need be concerned with the command window for now.

To start using Matlab, you only need be concerned with the command window for now. Getting Started Current folder window Atop the current folder window, you can see the address field which tells you where you are currently located. In programming, think of it as your current directory,

More information

Course Layout. Go to https://www.license.boun.edu.tr, follow instr. Accessible within campus (only for the first download)

Course Layout. Go to https://www.license.boun.edu.tr, follow instr. Accessible within campus (only for the first download) Course Layout Lectures 1: Variables, Scripts and Operations 2: Visualization and Programming 3: Solving Equations, Fitting 4: Images, Animations, Advanced Methods 5: Optional: Symbolic Math, Simulink Course

More information

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS 1 6 3 Matlab 3.1 Fundamentals Matlab. The name Matlab stands for matrix laboratory. Main principle. Matlab works with rectangular

More information

MATLAB Project: Getting Started with MATLAB

MATLAB Project: Getting Started with MATLAB Name Purpose: To learn to create matrices and use various MATLAB commands for reference later MATLAB functions used: [ ] : ; + - * ^, size, help, format, eye, zeros, ones, diag, rand, round, cos, sin,

More information

MATLAB Tutorial. Mohammad Motamed 1. August 28, generates a 3 3 matrix.

MATLAB Tutorial. Mohammad Motamed 1. August 28, generates a 3 3 matrix. MATLAB Tutorial 1 1 Department of Mathematics and Statistics, The University of New Mexico, Albuquerque, NM 87131 August 28, 2016 Contents: 1. Scalars, Vectors, Matrices... 1 2. Built-in variables, functions,

More information

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors.

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors. Physics 326G Winter 2008 Class 2 In this class you will learn how to define and work with arrays or vectors. Matlab is designed to work with arrays. An array is a list of numbers (or other things) arranged

More information

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices Introduction to Interactive Calculations Matlab is interactive, no need to declare variables >> 2+3*4/2 >> V = 50 >> V + 2 >> V Ans = 52 >> a=5e-3; b=1; a+b Most elementary functions and constants are

More information

Computer Programming in MATLAB

Computer Programming in MATLAB Computer Programming in MATLAB Prof. Dr. İrfan KAYMAZ Atatürk University Engineering Faculty Department of Mechanical Engineering What is a computer??? Computer is a device that computes, especially a

More information

Lecture 2: Variables, Vectors and Matrices in MATLAB

Lecture 2: Variables, Vectors and Matrices in MATLAB Lecture 2: Variables, Vectors and Matrices in MATLAB Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE201: Computer Applications. See Textbook Chapter 1 and Chapter 2. Variables

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB The Desktop When you start MATLAB, the desktop appears, containing tools (graphical user interfaces) for managing files, variables, and applications associated with MATLAB. The following

More information

DSP Laboratory (EELE 4110) Lab#1 Introduction to Matlab

DSP Laboratory (EELE 4110) Lab#1 Introduction to Matlab Islamic University of Gaza Faculty of Engineering Electrical Engineering Department 2012 DSP Laboratory (EELE 4110) Lab#1 Introduction to Matlab Goals for this Lab Assignment: In this lab we would have

More information

Introduction to MatLab. Introduction to MatLab K. Craig 1

Introduction to MatLab. Introduction to MatLab K. Craig 1 Introduction to MatLab Introduction to MatLab K. Craig 1 MatLab Introduction MatLab and the MatLab Environment Numerical Calculations Basic Plotting and Graphics Matrix Computations and Solving Equations

More information

Matlab Tutorial. The value assigned to a variable can be checked by simply typing in the variable name:

Matlab Tutorial. The value assigned to a variable can be checked by simply typing in the variable name: 1 Matlab Tutorial 1- What is Matlab? Matlab is a powerful tool for almost any kind of mathematical application. It enables one to develop programs with a high degree of functionality. The user can write

More information

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras Module No. #01 Lecture No. #1.1 Introduction to MATLAB programming

More information

A = [1, 6; 78, 9] Note: everything is case-sensitive, so a and A are different. One enters the above matrix as

A = [1, 6; 78, 9] Note: everything is case-sensitive, so a and A are different. One enters the above matrix as 1 Matlab Primer The purpose of these notes is a step-by-step guide to solving simple optimization and root-finding problems in Matlab To begin, the basic object in Matlab is an array; in two dimensions,

More information

ARRAY VARIABLES (ROW VECTORS)

ARRAY VARIABLES (ROW VECTORS) 11 ARRAY VARIABLES (ROW VECTORS) % Variables in addition to being singular valued can be set up as AN ARRAY of numbers. If we have an array variable as a row of numbers we call it a ROW VECTOR. You can

More information

MATLAB: The Basics. Dmitry Adamskiy 9 November 2011

MATLAB: The Basics. Dmitry Adamskiy 9 November 2011 MATLAB: The Basics Dmitry Adamskiy adamskiy@cs.rhul.ac.uk 9 November 2011 1 Starting Up MATLAB Windows users: Start up MATLAB by double clicking on the MATLAB icon. Unix/Linux users: Start up by typing

More information

AMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA

AMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA AMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA MATLAB (short for MATrix LABoratory) is a very useful piece of software for numerical

More information

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example:

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example: Using MATLAB for Stochastic Simulation. Eric W. Hansen. Matlab Basics Introduction MATLAB (MATrix LABoratory) is a software package designed for efficient, reliable numerical computing. Using MATLAB greatly

More information

Lab P-1: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization.

Lab P-1: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization. DSP First, 2e Signal Processing First Lab P-1: Introduction to MATLAB Pre-Lab and Warm-Up: You should read at least the Pre-Lab and Warm-up sections of this lab assignment and go over all exercises in

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 3 Creating, Organising & Processing Data Dr Richard Greenaway 3 Creating, Organising & Processing Data In this Workshop the matrix type is introduced

More information

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System CHAPTER 1 INTRODUCTION Digital signal processing (DSP) technology has expanded at a rapid rate to include such diverse applications as CDs, DVDs, MP3 players, ipods, digital cameras, digital light processing

More information

Some elements for Matlab programming

Some elements for Matlab programming Some elements for Matlab programming Nathalie Thomas 2018 2019 Matlab, which stands for the abbreviation of MATrix LABoratory, is one of the most popular language for scientic computation. The classical

More information

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing SECTION 1: INTRODUCTION ENGR 112 Introduction to Engineering Computing 2 Course Overview What is Programming? 3 Programming The implementation of algorithms in a particular computer programming language

More information

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano MATLAB Lesson I Chiara Lelli Politecnico di Milano October 2, 2012 MATLAB MATLAB (MATrix LABoratory) is an interactive software system for: scientific computing statistical analysis vector and matrix computations

More information

EE-3221 MATLAB INTRODUCTION

EE-3221 MATLAB INTRODUCTION MATLAB INTRODUCTION Goal Become familiar with MATLAB and its ability to manipulate and plot discrete signals (sequences of numbers). Background MATLAB is an industry-standard software package for processing

More information

Interactive Computing with Matlab. Gerald W. Recktenwald Department of Mechanical Engineering Portland State University

Interactive Computing with Matlab. Gerald W. Recktenwald Department of Mechanical Engineering Portland State University Interactive Computing with Matlab Gerald W. Recktenwald Department of Mechanical Engineering Portland State University gerry@me.pdx.edu Starting Matlab Double click on the Matlab icon, or on unix systems

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Chen Huang Computer Science and Engineering SUNY at Buffalo What is MATLAB? MATLAB (stands for matrix laboratory ) It is a language and an environment for technical computing Designed

More information

Lab 1 Intro to MATLAB and FreeMat

Lab 1 Intro to MATLAB and FreeMat Lab 1 Intro to MATLAB and FreeMat Objectives concepts 1. Variables, vectors, and arrays 2. Plotting data 3. Script files skills 1. Use MATLAB to solve homework problems 2. Plot lab data and mathematical

More information

PART 1 PROGRAMMING WITH MATHLAB

PART 1 PROGRAMMING WITH MATHLAB PART 1 PROGRAMMING WITH MATHLAB Presenter: Dr. Zalilah Sharer 2018 School of Chemical and Energy Engineering Universiti Teknologi Malaysia 23 September 2018 Programming with MATHLAB MATLAB Environment

More information

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks MATLAB Basics Stanley Liang, PhD York University Configure a MATLAB Package Get a MATLAB Student License on Matworks Visit MathWorks at https://www.mathworks.com/ It is recommended signing up with a student

More information

MATLAB The first steps. Edited by Péter Vass

MATLAB The first steps. Edited by Péter Vass MATLAB The first steps Edited by Péter Vass MATLAB The name MATLAB is derived from the expression MATrix LABoratory. It is used for the identification of a software and a programming language. As a software,

More information

MATLAB = MATrix LABoratory. Interactive system. Basic data element is an array that does not require dimensioning.

MATLAB = MATrix LABoratory. Interactive system. Basic data element is an array that does not require dimensioning. Introduction MATLAB = MATrix LABoratory Interactive system. Basic data element is an array that does not require dimensioning. Efficient computation of matrix and vector formulations (in terms of writing

More information

MATLAB TUTORIAL WORKSHEET

MATLAB TUTORIAL WORKSHEET MATLAB TUTORIAL WORKSHEET What is MATLAB? Software package used for computation High-level programming language with easy to use interactive environment Access MATLAB at Tufts here: https://it.tufts.edu/sw-matlabstudent

More information

Starting Matlab. MATLAB Laboratory 09/09/10 Lecture. Command Window. Drives/Directories. Go to.

Starting Matlab. MATLAB Laboratory 09/09/10 Lecture. Command Window. Drives/Directories. Go to. Starting Matlab Go to MATLAB Laboratory 09/09/10 Lecture Lisa A. Oberbroeckling Loyola University Maryland loberbroeckling@loyola.edu http://ctx.loyola.edu and login with your Loyola name and password...

More information

Grace days can not be used for this assignment

Grace days can not be used for this assignment CS513 Spring 19 Prof. Ron Matlab Assignment #0 Prepared by Narfi Stefansson Due January 30, 2019 Grace days can not be used for this assignment The Matlab assignments are not intended to be complete tutorials,

More information