MATH-680: Mathematics of genome analysis Introduction to MATLAB

Size: px
Start display at page:

Download "MATH-680: Mathematics of genome analysis Introduction to MATLAB"

Transcription

1 MATH-680: Mathematics of genome analysis Introduction to MATLAB Jean-Luc Bouchot, Simon Foucart January 14, Introduction As for the case of R, MATLAB is another example of interpreted programming language. Therefore the code is not compiled but translated on-the-fly by the interpreter. Note that MATLAB being very expensive, many open source copy have appeared around on the web. The most curious of you might want to google for Octave or Scilab. The first one is more or less a copy of MATLAB with a pretty much similar syntaxe while the second one is somewhat different (and the community working on it is much smaller). 2 Data types Dealing with different data in MATLAB is somewhat easier than with R. Strings and in general characters will barely be used except as an argument of a function (if for instance, you choose to use another method than the usual one). Most of the data you will be working with will be numeric. However MATLAB differentiates between floating point (real numbers, quotient etc...) and integers. Operations on integer are (almost) always much faster then on floating points numbers. Matrices are particularly powerful in MATLAB (whence the name: MATrix LABoratory) and you should try to use matrix representation whenever you can. Matrices in MATLAB are not necessarily two dimensional and can be of any dimension (similar to arrays in R). They are ordered in a column wise manner and are also considered as a vector. Therefore, if M denotes an m n matrix (a matrix with m rows and n columns), if you try to access the element on the first row and the i th column (1 i n) you can equivalently write: myvalue = M(1,i); myvalue = M( (i-1)*m + 1); If you want an element on the first column located on the i th row you can write myscdvalue = M(i,1); myscdvalue = M( (1-1)*m + i); % actually, M(i) is sufficient Exercise 1. Assume M is a matrix as above, and you are given two integers i and j such that 1 i m and 1 j n. How would you access the element M(i, j) using the vector notation of the matrix? A drawback of matrices is that all columns have to have the same size (or all rows have to have the same length, depending on how to look at the matrix). To overcome this issue one can use cells instead of matrices. They are used with curly braces { } instead of braces. The advantage of using cells is that it allows to store vectors of data of different sizes DNAsequences{1} = ATTCGTA ; DNAsequences{2} = AATGCCTATTGCA ; 1

2 There is no way to deal with such an example using only matrices in MATLAB. However when it comes to k-mers representations, the number of k-mers (4 k ) is already known and hence, an individual can be represented by a fixed size vector and all specimens will have the same size. Finally a last aspect for using different data is by defining what is called structures. A structure is an object where different fields can be specified. It can be understood as a list in the R language. Each field of a structure has a particular key or name and can be assigned anything (a matrix, a cell, a vector or even another structure). astudent.name = John Doe ; astudent.birthyear = 1990 ; astudent.address = 123 Foobar avenue ; In this example the variable is astudent while the different fields represent different characteristics of that variable. The boolean type is difficult to use in MATLAB. Even if a true and a false keywords exist, a number 0 will be considered as a boolean false whenever asked and any non zero number is considered as being a boolean true. Try copy pasting the following statements in your MATLAB window to convince yourself. if( 0.5 ) disp( 0.5 is true ) % appears only if the condition in IF is true end if( 0 ) disp( 0 is true ) % appears only if the condition in IF is true end As numeric variables or values can be sometimes used in conditions, some care should be taken in some places. 3 Basic operators Understanding the different operators in MATLAB is rather straigthforward. The = sign is used for assignment (a=5 affects the value 5 to a variable a) while the double one == is used for comparison (a==b) and returns a numeric (used as boolean in this case) 1 if the statement is true (a indeed equals b) and 0 (a boolean false) otherwise. More general comparisons work similarly using <=, <, > and >=. The negation is done using the tilda sign ~: a = 2; b = 1; myfirstbool = (a >= b) % should display 1 (a boolean true!) mysecondbool = (~(a < b) ) myfirstbool == mysecondbool The last statement compares the two boolean variables and should always return a 1 given any numbers a and b. As you might have noticed so far, MATLAB s syntax is quite different from the one of R. For instance, we have used the semicolon ; at the end of some lines and not at others. This is not random. As default MATLAB displays every result it computes. In order to avoid this annoying effect, the semicolon added at the end of a line tells MATLAB to stay quiet. Another major difference is dealing with comments. While R uses the # command to tell the interpreter to ignore everything afterwards, MATLAB uses %. Hence a=5 %and this will be ignored is equivalent to a=5. Remember to always comment your code. What is clear for you might not be that clear for someone else, even future you. A last difference with R is when asking for help. MATLAB uses the help command: help help for help about the help function. 2

3 Arithmetic and logical operators As for any other programming languages, MATLAB comes with a certain amount of built-in functions. Here are the few you really need to get used to. More advanced functions (such as singular value decomposition) can be studied later for more complex topics. Operations are used in a classical way: a=4; b=5; product = a*b sum = a+b quotient = a/b difference = a-b Note that the choice of name for a variable can be important in some cases. For instance in the previous example, the choice of sum on the fourth line is not smart. As we will see later sum() is also the name of a MATLAB function and this instruction will overwrite the definition of the function making it unavailable for the rest of the runtime (or until you clear the workspace). Note that some variables are also predefined in MATLAB and should not be overwritten (unless you are sure not to need them later), for instance: i, j as two representations of the same complex unit (the square root of 1). MATLAB will not tell you if you try to overwrite an already existing variable; so be careful! Variable creation and assignment When working only with single valued variable (any number in a usual sense or string) you do not need to take any care and any myvariabe=acertainvalue will work perfectly fine. However creating vectors and matrices can be done in many different ways. The first way is by defining directly the vector you will work with. For this, you need to use the brackets [] and write the values inside: myfirstvector = [ ]; This instruction creates a row vector containing all numbers from 1 to 4. Another (somewhat clearer) way to separate the different values is by using a coma. Hence the previous formulation is equivalent to [1,2,3,4] and to [1, 2, 3, 4]. Creating a column vector (i.e. oriented vertically) can be achieved using semicolon ; instead of periods or by transposing (using the command) a row vector. myfirstcolvector = [1; 2; 3; 4] myfirstcolvector2 = myfirstvector yield two exact same vectors (try it to convince yourself!). While it might not appear clear why MATLAB distinguishes between row vectors and column vectors, we will see on the example of the scalar product how these considerations make sense. In a more general sense, the brackets are used to concatenate or stack variables together. For instance if we need to add the number 5 at the end of the vector ( end means to the right for the row vector and to the bottom for the column one) we can reuse the previous one and just concatenate it with the value you want to add myextendedrowvector = [myfirstvector, 5] myextendedcolvector = [myfirstcolvector; 5] Note that in the first case we have used the coma separator, meaning that we add to the right, on the same row as the rest, while in the second case, we have used the semicolon, which means add to the bottom, in the same column. Exercise 2. Now we can see why the column and row vectors are different. Try for instance to add a value (say 6) to the right of column vector or to the bottom of the row vector. What is happening? What is the problem? Whenever you wish to concatenate variables or values together, you need to make sure the dimensionality are consistent. If you use the concatenation to the right, you want to make sure the number of rows are the same and when stacking together, the number of columns should be the same. 3

4 Exercise 3. Create a two row vectors of length 5 of you choice. Using the concatenation as above create 1. A vector of size A table of size 2 5. (Here you have created you first matrix!) 3. A vector of size (two equivalent ways) 4. A table of size Two tables of size 5 5 and 2 2 ( hint: try multiplying matrices together. Be careful about dimension conditions) Exercise 4. Try adding the value 0 at the beginning of the previous column and row vectors A last possibility to create a row vector is by using the sequence operator: :. It works as follows, myvector=firstidx:increment:lastidx. It creates a row vector with its leftmost value starting at firstidx and increasing (or decreasing for negative steps) step by step by increment until the maximum value lastidx is reached. If the increment is omitted, it will be replaced with 1 hence firstidx:1:lastidx and firstidx:lastidx are equivalent. otherrowvector = 1:4 othercolvector = (1:1:4) The symbol : is particularly important in MATLAB as it allows to select a complete row or vector, as we will see later. Creating a matrix can be done the exact same way by first filling the first row, then stack another row, and so on mymatrix = [1, 2, 3, 4; 5, 6, 7, 8] creates the following matrix: mymatrix = ( It is common to separate with a new line whenever we add a new row to the matrix (but this is just for the beauty of the code) mymatrix = [1, 2, 3, 4;... 5, 6, 7, 8] The dots at the end of the line are not mandatory (in this case) but it helps keeping track that the statement is not finished yet. Once again, you can deal with concatenation and stacks as for vectors and we suggest you try practicing by yourself. Some operations can be extended to the case of matrices. Hence, the following statements make sense C = A+B % A and B have same sizes D = A-B % A and B have same sizes E = A*B % nb of columns of A == nb or rows of B. What size does E have? F = A/B % B is invertible, dimensions are coherent G = A^2 % A is square On top of that, the component wise operations (for instance exponential, quotient and multiplication) can be done by adding a dot in front of the operator: A.*B is a matrix C of the same size as A and B whose components are the component wise products of each component. In a more formal way, say A and B are m n matrices, then C is a m n matrix too such that 1 i m, 1 j n, C(i, j) = A(i, j) B(i, j) ) 4

5 4 Working in a MATLAB environment Data creation can be done in a smarter way than the ones presented in the previous section. Unfortunately adding rows to a matrix during runtime is time consuming, and it is always better, if known, to preallocate the memory for the whole matrix beforehand. For this you can create different matrices using built-in functions m = 5; n = 10; % define the matrix size amatrix = zeros(m,n); % creates a 5x10 matrix filled with 0s anothermatrix = ones(m,n); % creates a 5x10 matrix filled with 1s rdmmatrix = rand(m,n); % creates a random matrix with values iid, uniform distribution rdmmatrix2 = randn(m,n); % same as above but normally distributed Once the memory for the matrix has been allocated you can always access (and modify as you wish) using the mymatrix(i,j) notation. Another useful notation for accessing and modifying matrix elements is the : symbol. It is interpreted as take everything along this direction. For instance M(:,i) is interpreted as all the components along the first direction and at the i th position in the second, or in other words, the i th column of the matrix M. You can also select subsets of the matrix by using vectors of indices inside the brackets M(1:3:12,2:2:16) will select only some predefined values of the matrix. Exercise 5. Create a diagonal 5 5 matrix D with the number 1 to 5 on the diagonal: D = now try to use the function diag() for the same purpose. (Remember to use the help: help diag) Dimensional information It is often very useful to recover information about the size of the data you are manipulating. For instance the length() function returns largest dimension of the matrix passed as argument. The size() command returns a vector containing the different lengths in each dimension. The values can be stored independently in separated variables. You can also give a second parameter to precisely recover the size of the given dimension m = 10; n = 20; % size parameters A = randn(m,n); % create a random matrix mysize = size(a) % returns a vector [10, 20] [l1, l2] = size(a) % affects the length of the matrix along dim 1 to l1 [l1,l2,l3] = size(a) % third output will be assigned a value of 1 scddimension = size(a,2) % recovers only the length of the scd dimension A last function used sometimes is numel() which tells you the number of elements in a certain variable. This is sometimes useful to check whether an assignment occurred as expected or if something wrong happened. In general, for an m n q array X, we have numel(x) = m n q. Vector information (Not the best name we can give though...) Many pieces of information can be recovered (almost) instantaneously using basic functions. Most of the function will work on a vector basis. For instance, the function sum(v) computes the sum of all elements of the vector v. However if the argument is a matrix, all the operations (in this case summing up) will be done along the first dimension (the sum function applied to a matrix returns a row vector where each element is the sum of all the element of the associated column. 5

6 amatrix = [1, 2, 3; 4, 5 6]; firstsum = sum(amatrix); firstsum2 = sum(amatrix,1); firstsum == firstsum2 % should return a vector of 1s isequal(firstsum,firstsum2) % compares the two vectors GLOBALLY -> important function! sum(amatrix ) == sum(amatrix,2) % should be 1 too As you can see from the examples, the second parameter tells along which direction to sum up. In some cases (for instance when one needs to have cumulative probability distribution) it is interesting to keep track of the cumulated sums. See the function cumsum() for that, which has a similar behavior as the normal sum regarding its parameters. Exercise 6. Compute the sum of all elements of a 2 dimensional matrix. The product command prod() has the exact same behavior as the sum. The functions min() and max() can be used in a similar way: max(x,dim). Exercise 7. Find the range of a matrix M using the min() and max() functions An interesting behaviour of the min and max functions is that it allows to recover the position of the max or min in the vector. A = randn(5,10); % Random matrix [minvalues, indices] = min(a) % Recover min values and position along each columns Exercise 8. Recover the maximum value and its position in a two dimensional array. (this is a hard task for novice programmers) Statistical information can be computed out of vectors using the var() and std() functions. As before, it works along the first dimension and a second argument can be passed in order to change the direction of computation. Together with the mean() function you should be able to get most of the basic statistics out a vector. Exercise Compute numel() without using this function 2. Compute length() without using this function Hint: Remember the the dim() function can be very useful sometimes. These two computations should work for any kind of data (matrix, vectors or even much higher dimensional data) Exercise 10. Assume you are given two column vectors x and y of the same size. Compute the scalar product of these two vectors without using loops (we don t know how to implement loops anyway). Remember, the scalar product is defined as the real number α = x i y i. One method uses only one line of code and another one uses two. Once we will see how to use loops, we can compare the efficiency of these methods compared to the one using loops for large vectors. Useful functions are already implemented in MATLAB. And therefore you can use without any problem exp() as the natural exponential function. If applied on the matrix, it corresponds to the coordinate wise exponential function. sqrt() computes the component-wise square root of a matrix. Note that if you are looking for the square root of a square matrix X (i.e. a matrix A such that A A = X), you want to use the function sqrtm(). Exercise 11. The square root and the square functions can be considered as inverse of each other. As an effect applying first the square root then the power two function should return the original number. As an example, try the following code a = 5; recovereda = (sqrt(a))^2 Does it give the expected result? Now compute the difference a-expecteda. What is the result? Is it normal? Why? Try the same process with the following matrix: A=[1,2,3;4,5,6]. Does it work? Why? Can you correct the code to get the expected solution? 6

7 Integer functions are function returning integers depending on the floating points. floor() returns the largest integer smaller than or equal to a given parameter, ceil() returns the smallest integer greater than or equal to a given parameter and round() returns the closest integer to a number, regardless of it being bigger or smaller. Exercise How would you compute the modulo (i.e. the remainder of the integer division)? 2. Pick a random integer in the range [0, 255] and check whether it is odd or even. 5 Scripts and functions As for the case of R it is often very useful to separate certain sets of instructions to another file and to call that file in the interpreter. Once again, calling a script is be equivalent to a copy-paste of the instructions in the file while calling a function you have created allows you to modify the variables locally and get the computed results in some other variables. In MATLAB the filenames end with the.m extension. Assume you want to normalise a certain vector x to have 0 mean value and unit variance and that this vector x will change along time. You can write the following separate donormalisation.m file: mu = mean(x); xnormalised = x - mu; sigma = var(xnormalised); xnormalised = x/sigma; Now in the flow of instructions, you could have: % x is already assigned as output of a function of some initilisations donormalisation; % Check the content of your workspace x = rand(1,123); donormalisation; % The content of the workspace has not changed, but their values have. For this kind of task the use of a separate function would be much smarter, as it avoids to overwrite variables and make it easier to remember names. Indeed, if you do not remember how you called the vector in the donormalisation.m file, you might end up initialising a vector named y which will not be affected by the script. To overcome this problem, modify this file by adding the line function [xnormalised, mu, sigma] = donormalisation(x) By doing this, you tell MATLAB that donormalisation is a function of the variable x (internally to that function) and that [xnormalised, mu, sigma]are the three outputs of this function. You do not have to use all of them if you do not want to: y = rand(1,150); % assign a random vector donormalisation(y); % does not do anything normalisedvector = donormalisation(y); % stores the normalised vector in this new variable [yn, avgy, deviationy] = donormalisation(y); % keep track of the interesting values of y In case you have optional arguments to pass, you need to use the nargin statement to check the number of argument or the isempty() function together with a if...then...else...end conditional block, as we will see in the next section. Loops and conditions are useful in MATLAB. They allow to repeat processes of to process a certain way under certain conditions. However, it is important to always vectorise your calculus as much as you can, as we will see in the next exercise. As for R we have access to two kinds of loops: the for loop and the while loop. As always for such cases, while is used whenever the stopping criteria can not be calculated beforehand: for instance while(convergenceisnotdone) or while(dbnotempty). Note that in the case of the database not empty case, we could actually recover the size of that database using size() and pass it into a for loop as follows: 7

8 % load a database represented as a matrix X [nbindividuals, lengthindividuals] = size(x); for oneindex=1:nbindividuals % do something to X(oneIndex,:) end % loop until nbindividuals are done You can also stipulate much more complicated sets to iterate on by simply writting for oneidx=acertainset where this certain set as already been defined (as a row or column vector). Note how you end your loop with the end statement. This is also the case for the while loop. It will also be the case to end a conditional block. Exercise 13. Create a myslowscalarproduct(x,y) function implementing the scalar product using a for loop. (you will basically iterate along the dimension of the vector and add each contribution to a auxiliary variable). Once this is done, make sure you get the correct result on some easy examples. Then copy-paste the following lines of code in your interpreter and conclude. vectorlength = ; % A big number; play with it! firstvector = rand(vectorlength,1); scdvector = rand(vectorlength,1); % second random number tic % this is a function to set the timer scalarproduct1 = y *x toc % end of the timer tic scalarproduct2 = sum(x.*y) toc tic scalarproduct3 = myslowscalarproduct(x,y) toc As a last tool for MATLAB programming we want to introduce the if... else... statement. This allows the user/programmer to distinguish between different use cases which can not be predicted beforehand. The best way to understand how it works is by observing the following example arandomnumber = rand(1); if( arandomnumber < 1/3 ) disp( The random number is pretty small ) else if( arandomnumber > 2/3 ) disp( The random number is pretty high ) else disp( The random number is close to 0.5 ) end; By running these few line a certain number of times, we can see that depending on the value of the random number (modify the code to display it if you wish) the interpreter will display different sentences. 8

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

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

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

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Andreas C. Kapourani (Credit: Steve Renals & Iain Murray) 9 January 08 Introduction MATLAB is a programming language that grew out of the need to process matrices. It is used extensively

More information

CME 192: Introduction to Matlab

CME 192: Introduction to Matlab CME 192: Introduction to Matlab Matlab Basics Brett Naul January 15, 2015 Recap Using the command window interactively Variables: Assignment, Identifier rules, Workspace, command who and whos Setting the

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

Computational Mathematics

Computational Mathematics Computational Mathematics Hilary Term Lecture 1: Programming Andrew Thompson Outline for Today: Schedule this term Review Introduction to programming Examples Arrays: the foundation of MATLAB Basics MATLAB

More information

MAT 343 Laboratory 2 Solving systems in MATLAB and simple programming

MAT 343 Laboratory 2 Solving systems in MATLAB and simple programming MAT 343 Laboratory 2 Solving systems in MATLAB and simple programming In this laboratory session we will learn how to 1. Solve linear systems with MATLAB 2. Create M-files with simple MATLAB codes Backslash

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB MATLAB sessions: Laboratory MAT 75 Laboratory Matrix Computations and Programming in MATLAB In this laboratory session we will learn how to. Create and manipulate matrices and vectors.. Write simple programs

More information

JME Language Reference Manual

JME Language Reference Manual JME Language Reference Manual 1 Introduction JME (pronounced jay+me) is a lightweight language that allows programmers to easily perform statistic computations on tabular data as part of data analysis.

More information

LAB 2 VECTORS AND MATRICES

LAB 2 VECTORS AND MATRICES EN001-4: Intro to Computational Design Tufts University, Department of Computer Science Prof. Soha Hassoun LAB 2 VECTORS AND MATRICES 1.1 Background Overview of data types Programming languages distinguish

More information

MATLAB GUIDE UMD PHYS401 SPRING 2011

MATLAB GUIDE UMD PHYS401 SPRING 2011 MATLAB GUIDE UMD PHYS401 SPRING 2011 Note that it is sometimes useful to add comments to your commands. You can do this with % : >> data=[3 5 9 6] %here is my comment data = 3 5 9 6 At any time you can

More information

Introduction to Scientific Computing with Matlab

Introduction to Scientific Computing with Matlab UNIVERSITY OF WATERLOO Introduction to Scientific Computing with Matlab SAW Training Course R. William Lewis Computing Consultant Client Services Information Systems & Technology 2007 Table of Contents

More information

Introduction to MATLAB. Simon O Keefe Non-Standard Computation Group

Introduction to MATLAB. Simon O Keefe Non-Standard Computation Group Introduction to MATLAB Simon O Keefe Non-Standard Computation Group sok@cs.york.ac.uk Content n An introduction to MATLAB n The MATLAB interfaces n Variables, vectors and matrices n Using operators n Using

More information

MATLAB BASICS. M Files. Objectives

MATLAB BASICS. M Files. Objectives Objectives MATLAB BASICS 1. What is MATLAB and why has it been selected to be the tool of choice for DIP? 2. What programming environment does MATLAB offer? 3. What are M-files? 4. What is the difference

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

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB MATLAB sessions: Laboratory MAT 75 Laboratory Matrix Computations and Programming in MATLAB In this laboratory session we will learn how to. Create and manipulate matrices and vectors.. Write simple programs

More information

Teaching Manual Math 2131

Teaching Manual Math 2131 Math 2131 Linear Algebra Labs with MATLAB Math 2131 Linear algebra with Matlab Teaching Manual Math 2131 Contents Week 1 3 1 MATLAB Course Introduction 5 1.1 The MATLAB user interface...........................

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

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

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

Downloaded from Chapter 2. Functions

Downloaded from   Chapter 2. Functions Chapter 2 Functions After studying this lesson, students will be able to: Understand and apply the concept of module programming Write functions Identify and invoke appropriate predefined functions Create

More information

MATH 3511 Basics of MATLAB

MATH 3511 Basics of MATLAB MATH 3511 Basics of MATLAB Dmitriy Leykekhman Spring 2012 Topics Sources. Entering Matrices. Basic Operations with Matrices. Build in Matrices. Build in Scalar and Matrix Functions. if, while, for m-files

More information

Getting To Know Matlab

Getting To Know Matlab Getting To Know Matlab The following worksheets will introduce Matlab to the new user. Please, be sure you really know each step of the lab you performed, even if you are asking a friend who has a better

More information

MBI REU Matlab Tutorial

MBI REU Matlab Tutorial MBI REU Matlab Tutorial Lecturer: Reginald L. McGee II, Ph.D. June 8, 2017 MATLAB MATrix LABoratory MATLAB is a tool for numerical computation and visualization which allows Real & Complex Arithmetics

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

Outline. User-based knn Algorithm Basics of Matlab Control Structures Scripts and Functions Help

Outline. User-based knn Algorithm Basics of Matlab Control Structures Scripts and Functions Help Outline User-based knn Algorithm Basics of Matlab Control Structures Scripts and Functions Help User-based knn Algorithm Three main steps Weight all users with respect to similarity with the active user.

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB MAT 75 Laboratory Matrix Computations and Programming in MATLAB In this laboratory session we will learn how to. Create and manipulate matrices and vectors.. Write simple programs in MATLAB NOTE: For your

More information

Introduction to MATLAB. Computational Probability and Statistics CIS 2033 Section 003

Introduction to MATLAB. Computational Probability and Statistics CIS 2033 Section 003 Introduction to MATLAB Computational Probability and Statistics CIS 2033 Section 003 About MATLAB MATLAB (MATrix LABoratory) is a high level language made for: Numerical Computation (Technical computing)

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

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

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

Lecture 2. Arrays. 1 Introduction

Lecture 2. Arrays. 1 Introduction 1 Introduction Lecture 2 Arrays As the name Matlab is a contraction of matrix laboratory, you would be correct in assuming that Scilab/Matlab have a particular emphasis on matrices, or more generally,

More information

Vectors and Matrices. Chapter 2. Linguaggio Programmazione Matlab-Simulink (2017/2018)

Vectors and Matrices. Chapter 2. Linguaggio Programmazione Matlab-Simulink (2017/2018) Vectors and Matrices Chapter 2 Linguaggio Programmazione Matlab-Simulink (2017/2018) Matrices A matrix is used to store a set of values of the same type; every value is stored in an element MATLAB stands

More information

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures Introduction to Octave/Matlab Deployment of Telecommunication Infrastructures 1 What is Octave? Software for numerical computations and graphics Particularly designed for matrix computations Solving equations,

More information

MATH 5520 Basics of MATLAB

MATH 5520 Basics of MATLAB MATH 5520 Basics of MATLAB Dmitriy Leykekhman Spring 2011 Topics Sources. Entering Matrices. Basic Operations with Matrices. Build in Matrices. Build in Scalar and Matrix Functions. if, while, for m-files

More information

ENGG1811 Computing for Engineers Week 10 Matlab: Vectorization. (No loops, please!)

ENGG1811 Computing for Engineers Week 10 Matlab: Vectorization. (No loops, please!) ENGG1811 Computing for Engineers Week 10 Matlab: Vectorization. (No loops, please!) ENGG1811 UNSW, CRICOS Provider No: 00098G1 W10 slide 1 Vectorisation Matlab is designed to work with vectors and matrices

More information

A very brief Matlab introduction

A very brief Matlab introduction A very brief Matlab introduction Siniša Krajnović January 24, 2006 This is a very brief introduction to Matlab and its purpose is only to introduce students of the CFD course into Matlab. After reading

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

7 Control Structures, Logical Statements

7 Control Structures, Logical Statements 7 Control Structures, Logical Statements 7.1 Logical Statements 1. Logical (true or false) statements comparing scalars or matrices can be evaluated in MATLAB. Two matrices of the same size may be compared,

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

CS 221 Lecture. Tuesday, 4 October There are 10 kinds of people in this world: those who know how to count in binary, and those who don t.

CS 221 Lecture. Tuesday, 4 October There are 10 kinds of people in this world: those who know how to count in binary, and those who don t. CS 221 Lecture Tuesday, 4 October 2011 There are 10 kinds of people in this world: those who know how to count in binary, and those who don t. Today s Agenda 1. Announcements 2. You Can Define New Functions

More information

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

Excerpt from Art of Problem Solving Volume 1: the Basics 2014 AoPS Inc. Chapter 5 Using the Integers In spite of their being a rather restricted class of numbers, the integers have a lot of interesting properties and uses. Math which involves the properties of integers is

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

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

Computational Finance

Computational Finance Computational Finance Introduction to Matlab Marek Kolman Matlab program/programming language for technical computing particularly for numerical issues works on matrix/vector basis usually used for functional

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

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

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

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

This is the basis for the programming concept called a loop statement

This is the basis for the programming concept called a loop statement Chapter 4 Think back to any very difficult quantitative problem that you had to solve in some science class How long did it take? How many times did you solve it? What if you had millions of data points

More information

An Introduction to MATLAB

An Introduction to MATLAB An Introduction to MATLAB Day 1 Simon Mitchell Simon.Mitchell@ucla.edu High level language Programing language and development environment Built-in development tools Numerical manipulation Plotting of

More information

Learning from Data Introduction to Matlab

Learning from Data Introduction to Matlab Learning from Data Introduction to Matlab Amos Storkey, David Barber and Chris Williams a.storkey@ed.ac.uk Course page : http://www.anc.ed.ac.uk/ amos/lfd/ This is a modified version of a text written

More information

TUTORIAL 1 Introduction to Matrix Calculation using MATLAB TUTORIAL 1 INTRODUCTION TO MATRIX CALCULATION USING MATLAB

TUTORIAL 1 Introduction to Matrix Calculation using MATLAB TUTORIAL 1 INTRODUCTION TO MATRIX CALCULATION USING MATLAB INTRODUCTION TO MATRIX CALCULATION USING MATLAB Learning objectives Getting started with MATLAB and it s user interface Learn some of MATLAB s commands and syntaxes Get a simple introduction to use of

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

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

CDA5530: Performance Models of Computers and Networks. Chapter 8: Using Matlab for Performance Analysis and Simulation

CDA5530: Performance Models of Computers and Networks. Chapter 8: Using Matlab for Performance Analysis and Simulation CDA5530: Performance Models of Computers and Networks Chapter 8: Using Matlab for Performance Analysis and Simulation Objective Learn a useful tool for mathematical analysis and simulation Interpreted

More information

CS129: Introduction to Matlab (Code)

CS129: Introduction to Matlab (Code) CS129: Introduction to Matlab (Code) intro.m Introduction to Matlab (adapted from http://www.stanford.edu/class/cs223b/matlabintro.html) Stefan Roth , 09/08/2003 Stolen

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Outline: What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display Facilities Flow Control Using of M-File Writing User

More information

UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING

UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 3 Matrix Math Introduction Reading In this lab you will write a

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

MATLAB GUIDE UMD PHYS401 SPRING 2012

MATLAB GUIDE UMD PHYS401 SPRING 2012 MATLAB GUIDE UMD PHYS40 SPRING 202 We will be using Matlab (or, equivalently, the free clone GNU/Octave) this semester to perform calculations involving matrices and vectors. This guide gives a brief introduction

More information

Matlab and Psychophysics Toolbox Seminar Part 1. Introduction to Matlab

Matlab and Psychophysics Toolbox Seminar Part 1. Introduction to Matlab Keith Schneider, 20 July 2006 Matlab and Psychophysics Toolbox Seminar Part 1. Introduction to Matlab Variables Scalars >> 1 1 Row vector >> [1 2 3 4 5 6] 1 2 3 4 5 6 >> [1,2,3,4,5,6] Column vector 1 2

More information

Chapter 1. Math review. 1.1 Some sets

Chapter 1. Math review. 1.1 Some sets Chapter 1 Math review This book assumes that you understood precalculus when you took it. So you used to know how to do things like factoring polynomials, solving high school geometry problems, using trigonometric

More information

MATLAB GUIDE UMD PHYS375 FALL 2010

MATLAB GUIDE UMD PHYS375 FALL 2010 MATLAB GUIDE UMD PHYS375 FALL 200 DIRECTORIES Find the current directory you are in: >> pwd C:\Documents and Settings\ian\My Documents\MATLAB [Note that Matlab assigned this string of characters to a variable

More information

9. Elementary Algebraic and Transcendental Scalar Functions

9. Elementary Algebraic and Transcendental Scalar Functions Scalar Functions Summary. Introduction 2. Constants 2a. Numeric Constants 2b. Character Constants 2c. Symbol Constants 2d. Nested Constants 3. Scalar Functions 4. Arithmetic Scalar Functions 5. Operators

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

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

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #43 Multidimensional Arrays In this video will look at multi-dimensional arrays. (Refer Slide Time: 00:03) In

More information

1. Variables 2. Arithmetic 3. Input and output 4. Problem solving: first do it by hand 5. Strings 6. Chapter summary

1. Variables 2. Arithmetic 3. Input and output 4. Problem solving: first do it by hand 5. Strings 6. Chapter summary Topic 2 1. Variables 2. Arithmetic 3. Input and output 4. Problem solving: first do it by hand 5. Strings 6. Chapter summary Arithmetic Operators C++ has the same arithmetic operators as a calculator:

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

Matrix Manipula;on with MatLab

Matrix Manipula;on with MatLab Laboratory of Image Processing Matrix Manipula;on with MatLab Pier Luigi Mazzeo pierluigi.mazzeo@cnr.it Goals Introduce the Notion of Variables & Data Types. Master Arrays manipulation Learn Arrays Mathematical

More information

Matlab and Octave: Quick Introduction and Examples 1 Basics

Matlab and Octave: Quick Introduction and Examples 1 Basics Matlab and Octave: Quick Introduction and Examples 1 Basics 1.1 Syntax and m-files There is a shell where commands can be written in. All commands must either be built-in commands, functions, names of

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

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

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

Eng Marine Production Management. Introduction to Matlab

Eng Marine Production Management. Introduction to Matlab Eng. 4061 Marine Production Management Introduction to Matlab What is Matlab? Matlab is a commercial "Matrix Laboratory" package which operates as an interactive programming environment. Matlab is available

More information

Matlab Tutorial, CDS

Matlab Tutorial, CDS 29 September 2006 Arrays Built-in variables Outline Operations Linear algebra Polynomials Scripts and data management Help: command window Elisa (see Franco next slide), Matlab Tutorial, i.e. >> CDS110-101

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

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation CDA6530: Performance Models of Computers and Networks Chapter 4: Using Matlab for Performance Analysis and Simulation Objective Learn a useful tool for mathematical analysis and simulation Interpreted

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

Lab copy. Do not remove! Mathematics 152 Spring 1999 Notes on the course calculator. 1. The calculator VC. The web page

Lab copy. Do not remove! Mathematics 152 Spring 1999 Notes on the course calculator. 1. The calculator VC. The web page Mathematics 152 Spring 1999 Notes on the course calculator 1. The calculator VC The web page http://gamba.math.ubc.ca/coursedoc/math152/docs/ca.html contains a generic version of the calculator VC and

More information

Visual Basic for Applications

Visual Basic for Applications Visual Basic for Applications Programming Damiano SOMENZI School of Economics and Management Advanced Computer Skills damiano.somenzi@unibz.it Week 1 Outline 1 Visual Basic for Applications Programming

More information

Introduction to Matlab

Introduction to Matlab What is Matlab? Introduction to Matlab Matlab is software written by a company called The Mathworks (mathworks.com), and was first created in 1984 to be a nice front end to the numerical routines created

More information

Introduction. Matlab for Psychologists. Overview. Coding v. button clicking. Hello, nice to meet you. Variables

Introduction. Matlab for Psychologists. Overview. Coding v. button clicking. Hello, nice to meet you. Variables Introduction Matlab for Psychologists Matlab is a language Simple rules for grammar Learn by using them There are many different ways to do each task Don t start from scratch - build on what other people

More information

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

Statistics Case Study 2000 M. J. Clancy and M. C. Linn Statistics Case Study 2000 M. J. Clancy and M. C. Linn Problem Write and test functions to compute the following statistics for a nonempty list of numeric values: The mean, or average value, is computed

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #29 Arrays in C

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #29 Arrays in C Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #29 Arrays in C (Refer Slide Time: 00:08) This session will learn about arrays in C. Now, what is the word array

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

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation CDA6530: Performance Models of Computers and Networks Chapter 4: Using Matlab for Performance Analysis and Simulation Objective Learn a useful tool for mathematical analysis and simulation Interpreted

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

MATLAB SUMMARY FOR MATH2070/2970

MATLAB SUMMARY FOR MATH2070/2970 MATLAB SUMMARY FOR MATH2070/2970 DUNCAN SUTHERLAND 1. Introduction The following is inted as a guide containing all relevant Matlab commands and concepts for MATH2070 and 2970. All code fragments should

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

LECTURE 1. What Is Matlab? Matlab Windows. Help

LECTURE 1. What Is Matlab? Matlab Windows. Help LECTURE 1 What Is Matlab? Matlab ("MATrix LABoratory") is a software package (and accompanying programming language) that simplifies many operations in numerical methods, matrix manipulation/linear algebra,

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

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

More information

An Introduction to Matlab for DSP

An Introduction to Matlab for DSP Brady Laska Carleton University September 13, 2007 Overview 1 Matlab background 2 Basic Matlab 3 DSP functions 4 Coding for speed 5 Demos Accessing Matlab Labs on campus Purchase it commercial editions

More information

6.001 Notes: Section 6.1

6.001 Notes: Section 6.1 6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of

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

A Quick Introduction to MATLAB/Octave. Kenny Marino, Nupur Chatterji

A Quick Introduction to MATLAB/Octave. Kenny Marino, Nupur Chatterji A Quick Introduction to MATLAB/Octave Kenny Marino, Nupur Chatterji Basics MATLAB (and it s free cousin Octave) is an interpreted language Two basic kinds of files Scripts Functions MATLAB is optimized

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