Introduction to MATLAB

Size: px
Start display at page:

Download "Introduction to MATLAB"

Transcription

1 Introduction to MATLAB Getting MATLAB to Run Programming The Command Prompt Simple Expressions Variables Referencing Matrix Elements Accessing Matrix Elements Assigning into Submatrices Matrix Concatenations More Expressions Plotting Logical Constructs Formatting Text "if" Statement "for" Loops "while" Statements Variable Scope Multiple Input Functions More on Logic

2 Getting Matlab to run To start the Matlab, type: >> matlab Or >> _matlab ver Programming The most awful truth about computers is that they are all dumb. Everything must be explicitly told. Spelling out the most minor and obvious detail. Otherwise, you will either get a syntax error (computer not understanding what you are saying) or a programming error (the computer understanding what you are saying but it is different from what you mean). There are many programing languages. Why use Matlab? As a first programming language, it is great, it has simple syntax, it is easy to get started with and easy to do graphics. While other programming languages are faster running they are slower to learn and to use. In addition, Matlab, as an interpreted language, is interactive, which allows for more exploratory programming. Once the exploration is done, one should consider rewriting the program in a different language if intensive use is required. The Command Prompt In the interactive terminal of Matlab you will see the command prompt (>>). This is Matlab's way of telling you that it is ready to receive instructions from you. To command Matlab, type your request and hit Enter. Matlab then evaluates your command and displays the output (if any). To get help use the help, and lookfor commands. help should be used to find out information about a known command, e.g. help zeros. lookfor can be used to find a command to perform a task e.g. lookfor roots. If you do not get the command prompt for some reason, you may have typed a syntax error, or have put Matlab into an infinite loop. Don't panic! press Ctrl-C and you'll get the prompt back.

3 Simple Expressions Matlab's most basic building blocks are expressions: 1, 1+1,4*3, 4^2, 5/6. But Matlab's real strength is in handling matrices and vectors. To enter a vector we use brackets. Try the following examples to see what happens: [1 2], [1:10], [1, 2 3 4; 5 6, 7 8 ; ] Notice that the colon is used to create an arithmetic sequence. We can also create a sequence with a step-size different from 1: [4:0.1:5], [5:-2:-5]. To transpose a matrix (or vector) use the apostrophe ('): >> [1:10]' Variables Asking Matlab to calculate things for us is great, but most of the times a calculation is only one step out of many and the result of a calculation need to be saved for the (very near) future. To do this we use 'variables', which are simply a way to name a bit of Matlab data. This is best explained by example: >> a=1 puts the value 1 into a variable called a. typing >> a results back in the value 1. We can also assign a calculation into a variable: >> b=1+1 and now b will contain the answer, 2. Variable names can (and should) be longer than one letter. A word or a couple of words strung together ts to work the best.

4 Referencing matrix elements We can access the elements of a matrix in the following manner: >> a=[ ] >> a(4) >> b=[1 2 ; 3 4] >> b(2,2) Where the numbers in the parenthesis are (row, column). Accessing Matrix Elements Submatrices We already say in the previous lecture that you can access the (2,3)th element of a matrix a with the notation >> a(2,3) This gives the entry of a in the second row and the third column. We can also gain access to several elements at the same time. Try for example: >> a(2, [1 2]) >> a([3 4], 3) >> a([2 3], [3 4]) These commands extract a submatrix of a with the corresponding set of rows and columns. It is often useful to extract a whole row or column of a given matrix. Assuming that B has 10 rows, we can extract the second column of B with the command >> B(2,1:10) Using the column notation instead of spelling out [ ]. In fact, there is more shorthand to be learned here. First, we can replace the 10 with the

5 keyword: >> B(2,1:) This keyword gets replaced by the largest number allowed for that place. So if it is used in the rows it will be replaced wit the number of rows, if in the columns, with the number of columns. It is useful to know that one can manipulate it as one would any other variable: >> B(2,1:-1) >> B(2,1:/2) Of course, if by the manipulation you get an illegal expression, matlab will complain: >> B(2,1:+1) >> B(2,sin():) The 1: construction is so useful that Matlab has a further shorthand for it: >> B(2,:) Means the same as B(2,1:). So, one should think of the bare colon (:) as meaning "everything". Non-contiguous element access The elements of the matrix that we access do not have to be contiguous: >> a(3,[2 4 6]) >> a([2 4], [1 3]) They don't have to be in increasing order: >> a(3,[2 6 4]) >> a([4 1], [3 2]) Nor do they have to only appear once: >> a(3,[ ]) >> a(3*ones(1,3),2*ones(1,10))

6 Assigning into submatrices Just as in the reference and assignment of single numbers into matrices, we can also assign new values into complete submatrices. The only thing that needs to be checked is that the matrix on the right of the equal sign has the same dimension as the matrix referenced on the left: >> a([2 3],[1 4]) =[1 2 ;3 4] >> a(1,1:4)=2:5 Scalar expansion Matlab has a nice time-saving notation. If an operator requires a matrix of a known size and instead is given a scalar (i.e a number). It "expands" the scalar into a full matrix of the required size. This is quite cumbersome to say...much better to show examples: >>1:10.^2 >>2.^1:10 >>[1 2; 3 4] + 5 In these three cases, the relevant operator is looking for a matrix of the same size as the one it already has on the other side, but instead it finds a number. So Matlab prets as if the matrix of the expected size is there with each of its entries equal to the number. Matrix concatenations Using the brackets we can create more and more complicated matrixs: >> [ones(2,2) zeros(2,2)] >> [ones(2,2) ; zeros(2,2)]

7 More Expressions All Matlab expressions are made out of basic building blocks put together: Constants Variables Operators Keywords Functions Constants We have met some constants already: 1, 3, 1.56, -5, pi. But there are more that we haven't yet met: i, j, (root of -1), 2.4e12 (2.4 times 10^12), 'a' (the character a),'hello' (a vector consisting of the letters 'h','e','l','l','o'). Note that i and jcan be used in a way different from variables: you can write 3i or -15j, but if you define a=10, writing 4a is an error... Also note that Matlab allow using the colon notation with letters:'a':'z'. Note that you can access letters in a string just elements in any other vector: >> a='hello' >> a(2) >> a(4:5)='p!' Variables There isn't much to say about variables. Variable names must start with a letter, and the variable name length must be no more than 32 characters. Names may use letters, numbers and the underscore '_'. Note that matlab will make matrixs and vectors grow as needed (filling the empty spaces with zeros): >> a = [1 2 ; 3 4] >> a(5,5) = 1

8 Operators We have met many operators: =,+,-,/,*,^,.,',[,],(,),;,:. There are a few others, as we shall see shortly. Keywords We have not yet seen many keywords...the only exception is. Functions We have seen: ones, zeros, diag, size,...there are others. For example: sin, cos, exp, log, sqrt. You can also define new functions as we shall learn in the next lecture or two. Plotting Let's learn how to make nice pictures. plotting is one of the basic tools of Matlab. Most of the plotting happens through plot and its variants. Best is to learn by example: >> x = 0:0.01:1 ; >> y = sin(x) ; >> plot(x,y) Notice several things. First, the semicolon ';' at the of the expression suppresses the output of the result. However, it does not inhibit the evaluation of the expression. So x and y are still as they would be if the semicolon was missing but the screen is blissfully clean (try it without the semicolon). Second, notice that the plot function created a nice figure for us, with the first "wave" of the sin. try it put with other functions. Logical Constructs Sometimes it is important to compare numbers. For example we might want to act differently if a given number is positive or negative. For this we need logical operators and comparisons.

9 Testing First, comparisons. we use the operators ==, ~=, < >, <=, >= (the ~ key is usually at the top left of the keyboard, and it needs the SHIFT key) to compare numbers e.g: >> 1==2 >> 3~=5 >> 5<=6 >> 7<=10 Notice that these expressions return 0 when they are false and 1 when the are true. This is the convention. 0 is false and 1 is true. While this notation looks similar to math, there are a few pitfalls 1<x<5 does NOT return what it does in math...in fact this will alway be true regardless of the value of x. Can you see why? == is not =. Regardless of how many time I will say this, people will still make this mistake many times...but perhaps by saying it lots, it will happen less...maybe. remember...you have been warned...= is assignment, and == is a test for equality. Boolean operations What if we want to check two things? A and B? or perhaps A and (B or C)...for this we need Boolean operators: & (AND), (OR), and ~(NOT) (The is usually found at the middle right of the keyboard, and it needs a SHIFT key.) 1~=2 3<4 3~=4 & 8==(4+4) ~(2<=8) Formatting Text Once in a while we would like to display some text that is nicely formatted and not just the output as Matlab wants to display. To do this we use the sprintf command. In its simplest form it is quite straightforward...the first arguemnt is a format string, and the rest are parameters for the string. examples: sprintf('hello, here is a number %d',17)

10 sprintf('my name is %s and I am %g years old','meysam',32) Read up on sprintf to get the whole picture Flow Control Up to now, we saw how to make Matlab execute a list of commands without any decision making. Now we will learn to have Matlab do different things deping on the results of previous expressions. if Statement We might want have Matlab evaluate a bunch of expressions if some condition is satisfied, and another bunch of expressions otherwise. The syntax for this is (don't type this into Matlab..) if condition Bunch Of expressions else Other expressions Note that you must replace the condition with an expression that Matlab will evaluate first. Example: >> if 3<4 '3 is less than 4' else '3 is not less than 4' >> Since the condition is true, the expression which is evaluated is '3 is less than 4', and this is then displayed on the screen. We can try something more interesting. Type the following into a file (say, if_example.m)

11 x = rand; s = 'The number %g is %s than 0.5\n'; if x<0.5 fprintf(s,x,'less') else fprintf(s,x,'more') Save the file and run it (either from the menu, or by typing the name of the file). You might be asked to change directory, do that. As you know, rand returned a (pseudo-)random number (to initialize it, you need to call something like rand('twister', sum(100*clock)), but read more about rand to find out why.) fprintf is similar to sprintf except that it writes the result instead of returning it. If you want to understand this a little further..read the help files and look at the difference in the output from the following commands: >> a=sprintf( Hello! ) >> b=fprintf( Hello! ) The '\n' at the of the string s is to make sure that Matlab actually goes down a line before returning us the command prompt...try removing it and see what happens. What is Truth? I'm not trying to get all philosophical or anything, but we need to know what matlab considers to be "true" and what to be "false", if we want to understand how the execution of an if statement works. For this I want you to create another file (oracle.m) with the following if x 'True' else 'False' Then, from the command line, assign various values to x and run your file. See if each x value is true or false. Things you can try out. x=(1==4) x=4 x=0

12 x=[0 0] x=[] x=[0 1] x=[1 2 3] x='hello' x='' x=' ' x=-1 x=i for Loops Loops are good when we want to do stuff over and over again. For example, if we didn't know how to sum up the elements of a vector using sum or linear algebra commands, we could use a loop to do it (a bad idea...much slower than the alternative, about 100 times slower!). But we might still need them...the syntax is as follows: for variable = vector a bunch of expressions here variable is an ELEMENT of vector The way it works is that for every element in vector, Matlab runs through all the commands in the block. during each such execution, the value of variable is set to that element...let see a simple example: for v = 1:10 v v^2 Notice that for every number from 1 to 10 we have two printouts (since there were two commands in the block) one simply the number and the other is the number squared...just as we asked. One can have any legal variable name instead of the variable, but note that it gets overwritten. Also the vector, can be any vector... for v = 'hello' v

13 One can "break out" of a loop before it is done by issuing a break command: for v = 'hello and goodbye' v if v=='d' break OK, enough new material..lets exercise! while Statements Sometime, you need to iterate many times but don't really want to create a vector, or you don't know in advance how many time you need to iterate...for this you can use a while statement. The syntax for a while statement is while expression a bunch of statements At the beginning of each iteration, Matlab evaluates the expression at the top of the loop. if it is true, Matlab executes the statements to the. If it is false, Matlab jumps to the and continues after it. So, for example: >> x=10; >> while x>0 x=x-1 >>

14 will print out all the numbers from 9 to 0 (including both) Take note of two things: Matlab does not check the expression all the time. Only before starting a new iteration If the expression at the top is false when the first iteration should start, it will not. Defining your own function While Matlab has a vast collection of functions, sometimes you want to add some of your own. A function should be thought of as a black box, with a slot in the top (for the input) and a drawer at the bottom for the output. When you give the function input ("call the function"), it calculates the output and puts it in the drawer ("returns it"). Once the function is written, you do not need to care about how it works. Functions must be defined in their own file, and the name of the file must match the name of the function. So, for example, to define a function called example_function_1, create a file named example_function_1.m. That file must start with the keyword function, so function y = example_function_1(x) is the first line of the file. let's dissect this first line: function As I said, the first word must be "function". y = This declares the local name of a variable whose value will be returned when the execution of the function is over. example_function_1 The name of the function. This must match the name of the file. (x) The local name of the variable that will contain the input value. So the rest of the file could be

15 y=2*x; admittedly, a very boring function: It takes the input value (locally called x), doubles it, and assigns that result to y. Since y is declared to be the return value and the function has ed, the return value is simply twice the input. we call the function by giving it a value: >> example_function_1(17) or >> example_function_1(rand) The return value can then be assigned to another variable: >> z= example_function_1(18); >> z Variable Scope An important difference between a function and a script (the files that don't have "function" as their first word are called scripts) is that of "variable scope". When executing a script from the command-line, the scripts has access to all the variables that are defined on the command line. For instance, if you have a script called script1.m whose contents are x+1 y=y/2 and you run this script from the commandline like so: >> x=2 >> y = 6 >> script1 >> y

16 You will see that the script knows that x=2 and that y=6. Not only this, note that y is changed in the scripts, the new value of y, 3 is also the value of y when check on the command line. This seems natural, perhaps, but this is not how functions behave. A function with the same content function1.m function function1 x+1 y=y/2 will fail to run, since within the function there are no such variables x and y. The variables of the function, are different from the variables outside the function, even if they have the same name. change your prime checking program so that the input is the number, and the output is 1 if the number is prime and 0 if not. change your n-changing program, so that the input is the initial value of n and the output is the number of steps it took to reach 1. use your primechecking function in another program (can be a script) that finds (a) the 1000th prime number and (b) the first prime number greater than use your n-changing function in another program (can be a script) that finds the number of iterations needed for the first 100 numbers, and plots then nicely. Multiple Input Functions You can define a function to have more than one input. This is the syntax: function r = func1(x,y) Remember that the name of the function must match the name of the file (with a.m added at the ). Therefore, no spaces, operators etc. in the name of the function. More on Logic

17 x = [ ], y = [ ].Evaluate and understand the following: o x>y o y>x o x==y o x<=y o x y o x&y o x&~y o ((x>y) (y>x)) o x<5 o x(y<5) x = [1:10], y = [ ]. Evaluate and understand the following: o (x>3)&(y<5) o x(x>5) o x(y>5) o y(x<=4) o x( (x<2) (x>=8) ) o y( (x<2) (x>=8) ) (remember, all nonzero values are true)

18 Exercises Learn about the commands ones, zeros, sum, and diag. Learn about magic and verify what you learned with sum. Create the vector consisting of the whole even numbers between 15 and 27. Create the vector consisting of the whole odd numbers between 15 and 27. Create the vector of the previous question in decreasing order. Verify that the sum along the anti-diagonal of the magic matrix is also the same as all the other rows, cols and the diagonal. (Hint: you can first change the order of the rows or columns before taking the diag) If A is a matrix, how can you get the sub-matrix of elements whose both coordinates are odd? Let x = [ ] and y = [ ]. Think of y as a specific reordering of the numbers 1:4. Use y to reorder x in the same fashion. Given a ``permutation'' vector as y is in the previous item. Find the vector which gives the inverse of the permutation! (Tricky!) Given two permutations p and q, find the permutations that is the same as p(q(s)) (that is it permutes the set s as if you would first permute with q and then with p) Write an expression for the sum of the integers from 1 to 100 Write an expression for the sum of the squares of the numbers from 1 to 10 Write an expression for the sum of the powers of 0.5 to the numbers from 1 to 10 Let x = [ ]. Add 3 to just the odd-index elements (resulting in a 2-vector), adds 3 to them and puts the result in the even positions of the original vector (overwriting the 2 and the 1). Create the matrix whose first column is the numbers 1:10, the next column contains the first 10 squares 1, 4, and the third column contains the first 10 powers of 2: Create the string of letters 'zyx...cba' Intertwine the two strings 'Hello!!' and 'Goodbye' (create the string 'HGeolold...!e') Plot the sin over a different interval Plot a more squiggily sin over the same interval plot the function x^2 between the numbers -5 and 5 plot the function log(x) from 1 to 10 (be sure that your plots are nice and smooth) plot a circle (think parametric plot) plot a Lissajou curve Plot a "heart" r = sin(theta/2)

19 Read more about plot and its optional arguments! Note that using plot with only one input argument does something a little strange (but useful at times...). Evaluate the sum of -1^(n+1) / (2n-1) for n from 1 to N where N=100. Find a value of N so that the sum is close to pi/4 (with difference < 10^-6) Find the sum of a vector x=[ ] without using the old tricks...that is, use afor loop and don't use sum. Write a little program that checks if x=73 is prime. Do not use isprime. But you might find mod or rem useful. Modify your program to find the first 20 primes Write a program that find the error in the calculation from the top of the page for N = 1, 10, 100,...10^6 and plots the results in a meaningful way. (you might want to consider using a log-plot, with loglog, or manually, taking the log from both axes before plotting) Find the value of the 100th Fibonacci number, using a while loop, and no big vectors. Write your prime checking program using a while loop instead of a for loop. Write a while loop that modifies n. if n is even it changes n to n/2, otherwise, it changes it to 3n+1. if n is 1 the loop stops. Try this out for several different starting values. Count how many steps you need to get to 1. Make a function for which the input is x and y and the output is x^y. From the command line, check the following inputs: o o >powerfunc(2,3); powerfunc(3,2); x=2; y=3; powerfunc(x,y); powerfunc(y,x) You can define more than one function inside a function file: func2.m: function y = func2(x) y = helper(x) function r = helper(q) r = q^2;

20 In this way, the functions inside the file are visible to all the other functions in the file. However, only the first can be called from outside the file. For x = [ ]: o Set to 0 the positive elements of x. o Set to 3 the multiples of 3. with 0 without 0 o Multiply by 5 the even elements of x o Create y from the elements of x that are > 10. o Set to 0 the elements less than the average. o Set to the distance from the average the elements greater than the average. Create r and c such that: ( ) ( ) r = ( ) ( ) ( ) c = r' Using r and c, create ( ) ( ) ( ) ( ) ( ) and ( ) ( ) ( ) ( ) ( )

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

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 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

18.S997: Introduction to Matlab Programming

18.S997: Introduction to Matlab Programming 18.S997: Introduction to Matlab Programming Yossi Farjoun December 8, 2011 1 Introduction Structure of the course: one term, 2 hours of lecture, and 1.5 hours of lab. Throughout the course there will be

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

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

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

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

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

Summer 2009 REU: Introduction to Matlab

Summer 2009 REU: Introduction to Matlab Summer 2009 REU: Introduction to Matlab Moysey Brio & Paul Dostert June 29, 2009 1 / 19 Using Matlab for the First Time Click on Matlab icon (Windows) or type >> matlab & in the terminal in Linux. Many

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

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

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

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

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

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

Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia

Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia The goal for this tutorial is to make sure that you understand a few key concepts related to programming, and that you know the basics

More information

MATLAB Introductory Course Computer Exercise Session

MATLAB Introductory Course Computer Exercise Session MATLAB Introductory Course Computer Exercise Session This course is a basic introduction for students that did not use MATLAB before. The solutions will not be collected. Work through the course within

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

AMS 27L LAB #2 Winter 2009

AMS 27L LAB #2 Winter 2009 AMS 27L LAB #2 Winter 2009 Plots and Matrix Algebra in MATLAB Objectives: 1. To practice basic display methods 2. To learn how to program loops 3. To learn how to write m-files 1 Vectors Matlab handles

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

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

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

EE 301 Signals & Systems I MATLAB Tutorial with Questions

EE 301 Signals & Systems I MATLAB Tutorial with Questions EE 301 Signals & Systems I MATLAB Tutorial with Questions Under the content of the course EE-301, this semester, some MATLAB questions will be assigned in addition to the usual theoretical questions. This

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

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 notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming using familiar mathematical notation The name Matlab stands

More information

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment What is MATLAB? MATLAB PROGRAMMING Stands for MATrix LABoratory A software built around vectors and matrices A great tool for numerical computation of mathematical problems, such as Calculus Has powerful

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Kristian Sandberg Department of Applied Mathematics University of Colorado Goal The goal with this worksheet is to give a brief introduction to the mathematical software Matlab.

More information

Physics 326 Matlab Primer. A Matlab Primer. See the file basics.m, which contains much of the following.

Physics 326 Matlab Primer. A Matlab Primer. See the file basics.m, which contains much of the following. A Matlab Primer Here is how the Matlab workspace looks on my laptop, which is running Windows Vista. Note the presence of the Command Window in the center of the display. You ll want to create a folder

More information

APPM 2460: Week Three For, While and If s

APPM 2460: Week Three For, While and If s APPM 2460: Week Three For, While and If s 1 Introduction Today we will learn a little more about programming. This time we will learn how to use for loops, while loops and if statements. 2 The For Loop

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 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

CITS2401 Computer Analysis & Visualisation

CITS2401 Computer Analysis & Visualisation FACULTY OF ENGINEERING, COMPUTING AND MATHEMATICS CITS2401 Computer Analysis & Visualisation SCHOOL OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING Topic 3 Introduction to Matlab Material from MATLAB for

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

6.001 Notes: Section 1.1

6.001 Notes: Section 1.1 6.001 Notes: Section 1.1 Slide 1.1.1 This first thing we need to do is discuss the focus of 6.001. What is this course all about? This seems quite obvious -- this is a course about computer science. But

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

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

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

Introduction to Matlab

Introduction to Matlab Introduction to Matlab November 22, 2013 Contents 1 Introduction to Matlab 1 1.1 What is Matlab.................................. 1 1.2 Matlab versus Maple............................... 2 1.3 Getting

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

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

Variable Definition and Statement Suppression You can create your own variables, and assign them values using = >> a = a = 3.

Variable Definition and Statement Suppression You can create your own variables, and assign them values using = >> a = a = 3. MATLAB Introduction Accessing Matlab... Matlab Interface... The Basics... 2 Variable Definition and Statement Suppression... 2 Keyboard Shortcuts... More Common Functions... 4 Vectors and Matrices... 4

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

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c.

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c. MATLAB BASICS Starting Matlab < PC: Desktop icon or Start menu item < UNIX: Enter matlab at operating system prompt < Others: Might need to execute from a menu somewhere Entering Matlab commands < Matlab

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

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

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003 Math 64 - Scientific Computing - Matlab Intro and Exercises: Spring 2003 Professor: L.G. de Pillis Time: TTh :5pm 2:30pm Location: Olin B43 February 3, 2003 Matlab Introduction On the Linux workstations,

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

MITOCW ocw f99-lec07_300k

MITOCW ocw f99-lec07_300k MITOCW ocw-18.06-f99-lec07_300k OK, here's linear algebra lecture seven. I've been talking about vector spaces and specially the null space of a matrix and the column space of a matrix. What's in those

More information

(Refer Slide Time: 1:27)

(Refer Slide Time: 1:27) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 1 Introduction to Data Structures and Algorithms Welcome to data

More information

APPM 2460 PLOTTING IN MATLAB

APPM 2460 PLOTTING IN MATLAB APPM 2460 PLOTTING IN MATLAB. Introduction Matlab is great at crunching numbers, and one of the fundamental ways that we understand the output of this number-crunching is through visualization, or plots.

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

Math 3 Coordinate Geometry Part 2 Graphing Solutions

Math 3 Coordinate Geometry Part 2 Graphing Solutions Math 3 Coordinate Geometry Part 2 Graphing Solutions 1 SOLVING SYSTEMS OF EQUATIONS GRAPHICALLY The solution of two linear equations is the point where the two lines intersect. For example, in the graph

More information

Applied Calculus. Lab 1: An Introduction to R

Applied Calculus. Lab 1: An Introduction to R 1 Math 131/135/194, Fall 2004 Applied Calculus Profs. Kaplan & Flath Macalester College Lab 1: An Introduction to R Goal of this lab To begin to see how to use R. What is R? R is a computer package for

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 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

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

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

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

Fourier Transforms and Signal Analysis

Fourier Transforms and Signal Analysis Fourier Transforms and Signal Analysis The Fourier transform analysis is one of the most useful ever developed in Physical and Analytical chemistry. Everyone knows that FTIR is based on it, but did one

More information

Matlab Tutorial 1: Working with variables, arrays, and plotting

Matlab Tutorial 1: Working with variables, arrays, and plotting Matlab Tutorial 1: Working with variables, arrays, and plotting Setting up Matlab First of all, let's make sure we all have the same layout of the different windows in Matlab. Go to Home Layout Default.

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

Math 2250 MATLAB TUTORIAL Fall 2005

Math 2250 MATLAB TUTORIAL Fall 2005 Math 2250 MATLAB TUTORIAL Fall 2005 Math Computer Lab The Mathematics Computer Lab is located in the T. Benny Rushing Mathematics Center (located underneath the plaza connecting JWB and LCB) room 155C.

More information

Basic stuff -- assignments, arithmetic and functions

Basic stuff -- assignments, arithmetic and functions Basic stuff -- assignments, arithmetic and functions Most of the time, you will be using Maple as a kind of super-calculator. It is possible to write programs in Maple -- we will do this very occasionally,

More information

Introduction to MATLAB Practical 1

Introduction to MATLAB Practical 1 Introduction to MATLAB Practical 1 Daniel Carrera November 2016 1 Introduction I believe that the best way to learn Matlab is hands on, and I tried to design this practical that way. I assume no prior

More information

Scientific Computing with MATLAB

Scientific Computing with MATLAB Scientific Computing with MATLAB Dra. K.-Y. Daisy Fan Department of Computer Science Cornell University Ithaca, NY, USA UNAM IIM 2012 2 Focus on computing using MATLAB Computer Science Computational Science

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

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

MITOCW ocw f99-lec12_300k

MITOCW ocw f99-lec12_300k MITOCW ocw-18.06-f99-lec12_300k This is lecture twelve. OK. We've reached twelve lectures. And this one is more than the others about applications of linear algebra. And I'll confess. When I'm giving you

More information

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015 SCHEME 7 COMPUTER SCIENCE 61A October 29, 2015 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

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

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

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

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

APPM 2460 Matlab Basics

APPM 2460 Matlab Basics APPM 2460 Matlab Basics 1 Introduction In this lab we ll get acquainted with the basics of Matlab. This will be review if you ve done any sort of programming before; the goal here is to get everyone on

More information

What is MATLAB and howtostart it up?

What is MATLAB and howtostart it up? MAT rix LABoratory What is MATLAB and howtostart it up? Object-oriented high-level interactive software package for scientific and engineering numerical computations Enables easy manipulation of matrix

More information

MATLAB: The greatest thing ever. Why is MATLAB so great? Nobody s perfect, not even MATLAB. Prof. Dionne Aleman. Excellent matrix/vector handling

MATLAB: The greatest thing ever. Why is MATLAB so great? Nobody s perfect, not even MATLAB. Prof. Dionne Aleman. Excellent matrix/vector handling MATLAB: The greatest thing ever Prof. Dionne Aleman MIE250: Fundamentals of object-oriented programming University of Toronto MIE250: Fundamentals of object-oriented programming (Aleman) MATLAB 1 / 1 Why

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Programming 1. Script files. help cd Example:

Programming 1. Script files. help cd Example: Programming Until now we worked with Matlab interactively, executing simple statements line by line, often reentering the same sequences of commands. Alternatively, we can store the Matlab input commands

More information

MATLAB Tutorial III Variables, Files, Advanced Plotting

MATLAB Tutorial III Variables, Files, Advanced Plotting MATLAB Tutorial III Variables, Files, Advanced Plotting A. Dealing with Variables (Arrays and Matrices) Here's a short tutorial on working with variables, taken from the book, Getting Started in Matlab.

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

Direct Variations DIRECT AND INVERSE VARIATIONS 19. Name

Direct Variations DIRECT AND INVERSE VARIATIONS 19. Name DIRECT AND INVERSE VARIATIONS 19 Direct Variations Name Of the many relationships that two variables can have, one category is called a direct variation. Use the description and example of direct variation

More information

Introduction to Matlab. By: Hossein Hamooni Fall 2014

Introduction to Matlab. By: Hossein Hamooni Fall 2014 Introduction to Matlab By: Hossein Hamooni Fall 2014 Why Matlab? Data analytics task Large data processing Multi-platform, Multi Format data importing Graphing Modeling Lots of built-in functions for rapid

More information

Congruence Arithmetic

Congruence Arithmetic Module 4 Congruence Arithmetic Popper 4 Introduction to what is like Modulus choices Partitions by modulus Mod 5 Mod 7 Mod 30 Modular Arithmetic Addition Subtraction Multiplication INTEGERS! Mod 12 Cayley

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

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

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

Computer Vision. Matlab

Computer Vision. Matlab Computer Vision Matlab A good choice for vision program development because Easy to do very rapid prototyping Quick to learn, and good documentation A good library of image processing functions Excellent

More information

CS195H Homework 1 Grid homotopies and free groups. Due: February 5, 2015, before class

CS195H Homework 1 Grid homotopies and free groups. Due: February 5, 2015, before class CS195H Homework 1 Grid homotopies and free groups This second homework is almost all about grid homotopies and grid curves, but with a little math in the middle. This homework, last year, took people about

More information

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 [talking head] Formal Methods of Software Engineering means the use of mathematics as an aid to writing programs. Before we can

More information

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017 SCHEME 8 COMPUTER SCIENCE 61A March 2, 2017 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

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 Fourteen Bonus Lessons: Algorithms and Efficiency

Chapter Fourteen Bonus Lessons: Algorithms and Efficiency : Algorithms and Efficiency The following lessons take a deeper look at Chapter 14 topics regarding algorithms, efficiency, and Big O measurements. They can be completed by AP students after Chapter 14.

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

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

Getting started with MATLAB

Getting started with MATLAB Getting started with MATLAB You can work through this tutorial in the computer classes over the first 2 weeks, or in your own time. The Farber and Goldfarb computer classrooms have working Matlab, but

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

MITOCW watch?v=se4p7ivcune

MITOCW watch?v=se4p7ivcune MITOCW watch?v=se4p7ivcune The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

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