Math 1322, Fall 2002 Introduction to Matlab: Basic Commands

Size: px
Start display at page:

Download "Math 1322, Fall 2002 Introduction to Matlab: Basic Commands"

Transcription

1 Math 1322, Fall 2002 Introduction to Matlab: Basic Commands You should look at Sections of the Matlab reference book ( Using Matlab in Calculus by Gary Jensen), preferably with Matlab running in front of you. Do not worry about remembering each and every command. Try to get an overview of the basics and what topics are referred to in the book so you can return to them when needed. The material there will probably be easier to read if you go through these notes first. Availability Matlab is available on PC's in the Artsci Computing Center in Eads and in the Center for Engineering Computing. It should also be available on the computers at Cornerstone and in the Residential Computing Facilities. Starting Matlab on a PC If there is a Matlab icon on the desktop, double click on it If not, use the menus: Start, Programs, Matlab You will then be in the Matlab workspace where you can enter commands Quitting Matlab You can use the menus: OR, just type: File, Exit Matlab quit Help See p.1 of Using Matlab in Calculus Numbers, Arrays, Variables Matlab thinks in terms of numbers and arrays. For example Names a = [ ] An array containing 4 numbers (called its elements or members or components). An array with a single row (or column) is sometimes also called a vector. We mostly use arrays with just one row in Calculus I-II The same array in Matlab can also be entered with commas: a = [1,3,5,7] But when Matlab displays an array on screen, it always omits commas and brackets b = An array with 2 rows and 3 columns If we like, we can give arrays more imaginative names than a or b. For example evens = [8, 6, 4, 2, 0] or time_intervals = [1, 3, 5, 7, 8, 6, 4, 2, 0] (Blank spaces are not allowed in names: use an underscore character to connect the parts) a, evens and time_intervals are examples of variable names in Matlab. A variable can refer either to a number or an array: b = 7 a = [1, 3, 5, 7] ( Actually, we can also think of 7 as being an array: the 1-element array [7].)

2 Names in Matlab are case sensitive for example, Evens is different from evens Names can be up to 19 characters, must start with a letter, and can't contain punctuation symbols. A good name for a variable can remind you about what information it contains. For example, if we measure the room temperature (F Ñ each hour for 6 hours, we might enter the data in an array called tempdata : tempdata = [68,72,84,87,90,94] In Matlab, there are certain built-in special variable names for example pi you can guess! i, j both stand for the complex number È " (which we won't use) ans the variable that holds the number or array which resulted from the most recent Matlab calculation You can preempt these names and use them for your own variables if you want. For example, you're allowed to define a variable pi = but this isn't a wise practice! Format Matlab normally displays 4 digits (although it carries about 16 digits in its internal calculations). The commands format long format short help format will display more digits returns the display to the shorter display displays some of the other format options Creating Arrays You can create an array in Matlab in several ways: 1) by directly typing it in a = [1, 3, 5, 7] (or a = [ ] without commas, if you like) a = [1,3,5 ; 7,8,9] to create The semicolon " ; " starts a new row as you enter the numbers 2) by specifying the stepsize from one element to the next a = [1:2:7] T his means: start with 1, increase in steps of size 2, and end with 7, giving a = [1, 3, 5, 7] again. If you like, you can leave off the brackets and simply enter a = 1:2:7 a = 1:4 For example, we could create If the stepsize is omitted, it is assumed to be 1, so creates the array a = [1, 2, 3, 4]

3 b = [8, 6, 4, 2, 0] by typing it in directly, or by typing b = 8: 2:0 Negative stepsizes are allowed. This command means: start at 8, decrease in steps of size 2, stop at 0 Notice that b = [8: 2 À 1] produces the same array b = [8,6,4,2,0] since adding 2 to 0 would go past the stopping value 1Þ last number created before the stopping value 1 c = 0:50: creates the array c = [0,50,100,150,...,100000] (The... is not part of Matlab: in these notes it just means and so on. ) It would be very time-consuming to enter the whole array by actually typing all the entries. This array c is very long (how many elements does it have?). If all these elements are displayed on the screen, it's a lot of clutter you don't need to see. How to avoid this? When there's a semicolon ; at the end of a command, Matlab creates the variable in memory but doesn't produce a display. A wiser command, therefore, would probably be: c = 0:50:100000; 3) By specifying the number of elements in the array In 2) we specified the stepsize (and the number of elements in the array is whatever it turns out to be). An alternative is to specify the number of (equally-spaced) elements in the array (and then the stepsize is whatever it turns out to be). The command a = linspace(1,5,7) creates an array of 7 points equally spaced ("linearly spaced") from 1 to 5. Notice that these seven numbers divide the interval [ 1,5 ] into six equal subintervals. Rounded to 4 decimal places, a = [ ] (As usual, Matlab omits the brackets in its display.) 3) By piecing together two arrays you have already defined If you already have a = [1, 3, 5] and b = [2, 4, 6], you can use the commands: c = [a b] to create c = [1, 3, 5, 2, 4, 6] or c = [b a] to create [2, 4, 6, 1, 3, 5] or c = [b ; a] to create (when a,b have the same length)

4 During a long Matlab session you might have defined many variables. The following commands are useful to know what you've got and to clean up : The command: who lists all the current user-defined variables clear a causes Matlab to forget a or undefine a clear a b causes Matlab to undefine a and b (note: no comma!) clear causes Matlab to undefine all user-defined variables: CAUTION! Exercise You want to divide the interval [1, 7] into 10 equal subintervals. In three different ways, create an array called endpoints which lists, in order of increasing size, the endpoints of all the subintervals. Arithmetic using numbers and arrays We can multiply an array by a number: If a = [2, 4, 6] then 2*a = [4, 8, 12] If a and b have the same number of elements, we can add and subtract arrays: If a = [2, 4, 6] and b = [1, 3, 7] then a + b = [3, 1,13] and a b = [1, 7, 1] We are also able to multiply and divide the elements in arrays by using the commands.* and./ (note the dots (periods) in front of * and / ) If a = [2, 4, 6] and b = [1, 3, 7] then a.*b = [2, 12, 42] and a./b = [2.000, 1.333, ] (rounded to 4 places) We can also exponentiate the elements (note the dot again in the command) If a = [2, 4, 6] then a.^2 = [4,16, 36] and 2.^a = [4,16,64] If b = [1, 2, 3] then a.^b = [2,16,216] and b.^a = [1, 16, 729] Note: Between numbers, we do not need the dot : 2*3 ß 2/3 and 2^3 work fine (although 2.*3 2./3 and 2.^3 will also work since 2 and 3 can be thought of as the arrays [2] and [3] ). For the arrays a,b above, the commands a*b ß a/b and a^b (without the dot ) will produce error messages. The operations * and / (without the dot ) are used between certain arrays in Matlab to do something quite different and irrelevant for now. )

5 Exercise Let a = [1,2,3]. In which of the following can the Þ be safely omitted? What do you get in each case? 2Þ a a.^2 2.^a 2.*a a./2 2 Þ/a max(a).*a Built-in Functions Matlab has the usual list of built-in functions, just like a calculator. These include, for example: trig functions inverse trig functions exponential and log functions sin, cos, tan, etc. (when using trig functions, Matlab always works in radians.) asin, acos, atan, etc. exp(x) is e x log in Matlab always means base e. Matlab's log is called ln in most elementary calculus texts) To find a logarithm in base 10, use the command log10(x) Exercises (by hand): exp(1) =? log(exp( #)) =? exp(log10(1)) =? exp(log( $ )) =? absolute value abs(x) is lx l square root sqrt( x ) is the nonnegative square root of x. help elfun displays a more complete list of built-in functions ( elfun = elementary functions ) Using the built-in functions The built-in functions can be applied to numbers (like sin(2)) just as on a calculator, but also to arrays, giving a new array as the answer. if a = [1,4,9] then sin(a) = [sin(1),sin(4),sin(9)] = [.8415,.7568,.4121] (rounded) and sqrt(a) = [1 2 3] if a = linspace(0, 2*pi, 5) then sin(a) = [0,1,0, 1,0] ( explain why) if a = linspace(0, 5, 7) then (sin(a)).^2 + (cos(a)).^2 = [1,1,1,1,1,1,1] ( explain) if a = [ 3,4, 1, 5] then abs(a) = [3,4,1,5] The are some other useful functions that also apply to arrays:

6 Exercises if a = [ 7,3,5] sum adds the elements: sum(a) = 1 length counts the elements: length(a) = 3 max gives the biggest element: max(a)=5 min gives the smallest element: min(a)= 7 abs kills the signs: abs(a) = [7, 3, 5] mean averages the elements: mean(a) = (rounded) sort sorts into increasing order: sort( a) = [ 5, 3, 7] 1. Suppose a = [1,3, 7,5]. By hand, find length(a) max(abs(a)) max(a)*min(a) length(max(a)) Check your answers by using Matlab. 2. Suppose you give the following commands: a = linspace(1,4,4) à b = 4: 2: 3 à max(b.^a) min (b.^a); ans.^2 Note: you can put more than one command on a line they are separated by a semicolon What then would be the values of ans.^2? sum(a.*b)? 3. Let a = 1:5. How do you create b = the array of reciprocals of elements of a? Making Simple Plots If you want to plot the graph of a function y = f(x) by hand, one way is make a list of the x-values compute the corresponding y-values plot the pairs (x,y) on a set of coordinate axes connect the points Every graphing device does it just like that, connecting the plotted points with straight line segments. If the x-values are very close together, then you can't see that the curve really consists of straight line segments it looks like a circle, a parabola, or whatever. Matlab does the same thing.

7 B To plot the graph of Cœ0ÐBÑœ " B over (say) the interval [ #ß# ], we can do the following # commands one after the other: x = linspace( 2,2,5) pick an array of 5 equally spaced x-values between 2 to 2 y = x./ (1 + x.^2) compute the y values: note the. plot (x,y) plot the points and connect them Matlab automatically picks an appropriate window size and scale on the axes and supplies tick marks. The graph appears in a new "figure" window. This graph looks pretty bad (angular) because we used so few points. It looks fine if we use more points, as x = linspace( 2,2,50) pick an array of 50 x-values; using a lot more than 50 wouldn't improve the picture noticeably y = x./ (1 + x.^2) compute the y values: after changing x, you need to enter this command again to compute the new y values plot (x,y) plot the curve The plot command can contain several functions, all to be graphed on the same screen. If we # x x want the graphs of f(x) = and g(x) = on the same screen, we also define 1+x 1+x # # z = x.^2./ (1+x.^2) plot (x,y,x,z) Notice we use a different letter for the output array z because we don't want to overwrite the array y that we also need The command The command plot ( x, y, '--',x,z) creates a dashed plot for the first curve y = f(x). Replacing ' --' with ' : ' makes a dotted graph. This is handy to distinguish the two graphs if you don't have a color printer. help plot shows you some of the extra plotting bells and whistles There are many additional commands for enhancing the picture. Here are a few. x=linspace( 2,2,50); z=x.^2./(1+x.^2); plot (x,y,x,z,':') xlabel ('x=time') ; ylabel('y') title ('Ron Freiwald,Two Graphs') grid on grid off adds the text in quotes to axes; DO THIS ON ALL YOUR GRAPHS! Note there are two commands here one for each axis. adds text in quotes as a title at the top of the figure. ALWAYS PUT YOUR NAME AND A TITLE ON YOUR GRAPHS adds a horizontal and vertical grid to the picture, and removes them

8 legend('x/(1+x^2)','x^2/(1+x^2)') labels the graphs (keep the commands in the same order as they were graphed) You can also add text, arrows, and straight line segments to your graphs by using the buttons on the toolbar in the figure window. Experiment! If you want to put several graphs on the same screen but with separate commands, you have to tell Matlab to "hold" the current screen, using the command hold on hold off clf holds the current graphing window for more graphs releases the current graphing window so that it can be overwritten. erases the last picture ( clear last figure ) Printing graphs Use the printer icon on the toolbar, or the menu commands: file, print

9 Example x=linspace(0,2*pi,50); y=sin(x); plot(x,y,'+') plots only the data points (without connections), using a + for each point plot(x,y,'+',x,y) plots the data points as +'s; then graphs the curve by connecting the points. You end up with the curve with the data points highlighted as well Example t=linspace(0,2*pi,50); x=cos(t); y=sin(t); plot(x,y); Here x,y are given in terms of a 3rd variable or "parameter" t. The points (x,y) are evaluated for each t value and then the points (x,y) are plotted. The axes are x and y: t doesn't appear in the picture. If you were only interested in the picture, you could omit the definitions of x and y and, after line 1, simply command plot(cos(t),sin(t)) The graph is supposed to be a circle. (Why? For any t, if you compute x^2+y^2 by hand, what do you get? ) However, the picture looks like an ellipse! That's because of Matlab's scaling: the units are of unequal lengths on the axes. Sometimes that's very convenient, but it does distort shapes. The unequal scaling also distorts slopes. If you give the commands hold on plot (t,t) you add a line of slope 1 (why?) to the picture but it doesn't look like it's at 45 inclination to the horizontal. If you want shapes and slopes not distorted, then axis equal axis normal creates equal scales on the axes, and returns to the Matlab's original scaling. To see other axis commands that are available, use Also see help axis Using Matlab in Calculus, especially the reference on p. 17 to "axis tick marks." Exercise 1) Plot the graph of the function y = f(x) = 3x+5 for x over the interval [ 2,4]. 2) How many points did you use in your array of x-values? Was this the most efficient choice? Why or why not?

10 Making a table of values of a function We may want to make a table of values for a function, or to put into a table the data collected from some experiment. For example, suppose we want to make a table of the values of # y = f(x) = x for x = 1,2,...5. We can start by making a chart with the x-values in one row and the y-values in the second row: x = 1:10 ; y = x.^2 ; chart = [x ; y] Note the semicolon ; used to start a second row in chart The result is chart = ( As usual, Matlab displays on screen without the brackets.) If we'd prefer a table with vertical columns, use the Matlab command table = chart ' The operation prime ' creates the transposed array; the first row of chart becomes the first column of table, etc., so table = Ô Ö Ù 4 16 Õ5 25Ø Writing M-files (script files) It can be awkward to correct errors made in the Matlab workspace, especially if a calculation is long and previous commands have scrolled off the screen as you executed new ones. You have probably noticed already that you can't just use the mouse to move to an old command and edit it. The best you can do is to use the up-arrow key Å to move back through the history list of earlier commands until you resurrect the old command you'd like to edit. Therefore, except for very simple jobs, we usually write our instructions to Matlab in a separate file and then have Matlab run the whole sequence of commands (the program ) at one time. If an error turns up, we go back to the file, make and save the corrections, and execute the file again. These files are called script files because they are written in ordinary text: you could, in fact, create them on any word processor, provided you save the file as a text file. When you create and save these files through Matlab, you provide a name (like, say, myfile1 ) and Matlab automatically adds extension.m to the name to identify the file as a Matlab file. Its full, official name would be myfile1.m and so these files are also referred to as m-files.

11 To create an m-file in Matlab use the blank white sheet" icon at the upper left of the toolbar to open a new (empty) Matlab m-file. (Or, use the menu commands: file, new, m-file ) A window will open for Matlab Editor/Debugger. Simply type your commands there. For example, enter the lines t = linspace(0,2*pi,50); x = cos (t); y = sin (t); plot (x,y); %Choose 50 equally spaced points between 0,2*pi %Compute cos of each point %Compute sin of each point %Plot the points and connect the dots (Note: Matlab ignores anything on a line following a % symbol. This lets you add comments on some of the lines in your m-file as illustrated above.) To save your m-file, Use the Save icon on the toolbar (looks like a diskette ), or use the menu commands: file, save Either way, for a new file, you'll be asked to give the file a name for example myfile1 (Don't include.m as part of the name; Matlab will automatically add the extension.m ) You should save the work in the suggested folder "Work," since that's where Matlab normally looks to find m-files. Note: files left in the Work directory on computers in Eads 14 (and perhaps elsewhere on campus) will be erased each day. This is to prevent a buildup of clutter on the hard drive, and also as antiviral protection. Anything you want to keep should be saved on your own diskette in the a: drive You can copy the files you want from the Work directory to the a: drive before you leave. Or you can also choose to save files directly to the a: drive during the original save process. To run your m-file (program), from the toolbar select: tools, run Alternately, you can return to the Matlab workspace window and simply enter the name of your file to execute it: say, myfile1 Note: If you do this, Matlab will, by default, look in the Work folder to find this file. If it can't find it because, say, you saved the file instead on your a: drive then you'll get an error message. If possible, keep your m-files in the Work folder during a working session. You see your instructor to learn how to direct Matlab to look instead on the a: drive for your m-files. Or, to make Matlab go to the a: drive to find this file, you can use the command a:myfile1

12 The script will run in the Matlab workspace area. You will get an error message (sometimes rather cryptic!) if something's wrong somewhere in the script you wrote. In that case, find the error, correct it in the script file, save it again, and then run it again. If a program isn't working and you run out of time, it's useful to save a copy of the file. It's very hard for anyone else to try to help if they can't see the exact file that was creating the problem. Writing script files 1) lets you keep the sequence of commands right in front of you 2) makes it easier to correct mistakes 3) makes it easier to modify the script to run a slightly different version another time 4) allows you to save your work and open it again later. From inside Matlab, you can open an m-file you've previously saved by using the open icon (looks like an opening folder on the toolbar, or by using the menu commands: file, open You should then see the available list of files in the Work folder and can select the file you want. If you forget the name of a file and are in the Matlab workspace, the command what lists all the m-files in the current directory ( œ the "Work" directory unless you have changed it). Interrupting Matlab Sometimes an error of a misjudgment sends Matlab into a long calculation that you want to interrupt: Use the key combination Ctrl-C to stop Matlab's calculation. Miscellaneous If you're entering a line that's too long to fit on the screen, you can continue it to the next line: use three periods (... ) at end of your typing to continue to the next line.

LAB 1 General MATLAB Information 1

LAB 1 General MATLAB Information 1 LAB 1 General MATLAB Information 1 General: To enter a matrix: > type the entries between square brackets, [...] > enter it by rows with elements separated by a space or comma > rows are terminated by

More information

Introduction to Engineering gii

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

More information

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

Programming in Mathematics. Mili I. Shah

Programming in Mathematics. Mili I. Shah Programming in Mathematics Mili I. Shah Starting Matlab Go to http://www.loyola.edu/moresoftware/ and login with your Loyola name and password... Matlab has eight main windows: Command Window Figure Window

More information

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

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

More information

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

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

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

More information

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

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

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

More information

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

General MATLAB Information 1

General MATLAB Information 1 Introduction to MATLAB General MATLAB Information 1 Once you initiate the MATLAB software, you will see the MATLAB logo appear and then the MATLAB prompt >>. The prompt >> indicates that MATLAB is awaiting

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

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

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

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

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

More information

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

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

More information

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

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

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

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

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

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

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

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

Activity: page 1/10 Introduction to Excel. Getting Started

Activity: page 1/10 Introduction to Excel. Getting Started Activity: page 1/10 Introduction to Excel Excel is a computer spreadsheet program. Spreadsheets are convenient to use for entering and analyzing data. Although Excel has many capabilities for analyzing

More information

Introduction to MATLAB

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

More information

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

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

1. Register an account on: using your Oxford address

1. Register an account on:   using your Oxford  address 1P10a MATLAB 1.1 Introduction MATLAB stands for Matrix Laboratories. It is a tool that provides a graphical interface for numerical and symbolic computation along with a number of data analysis, simulation

More information

2.0 MATLAB Fundamentals

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

More information

3+2 3*2 3/2 3^2 3**2 In matlab, use ^ or ** for exponentiation. In fortran, use only ** not ^ VARIABLES LECTURE 1: ARITHMETIC AND FUNCTIONS

3+2 3*2 3/2 3^2 3**2 In matlab, use ^ or ** for exponentiation. In fortran, use only ** not ^ VARIABLES LECTURE 1: ARITHMETIC AND FUNCTIONS LECTURE 1: ARITHMETIC AND FUNCTIONS MATH 190 WEBSITE: www.math.hawaii.edu/ gautier/190.html PREREQUISITE: You must have taken or be taking Calculus I concurrently. If not taken here, specify the college

More information

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below.

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below. What is MATLAB? MATLAB (short for MATrix LABoratory) is a language for technical computing, developed by The Mathworks, Inc. (A matrix is a rectangular array or table of usually numerical values.) MATLAB

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

Objectives. 1 Running, and Interface Layout. 2 Toolboxes, Documentation and Tutorials. 3 Basic Calculations. PS 12a Laboratory 1 Spring 2014

Objectives. 1 Running, and Interface Layout. 2 Toolboxes, Documentation and Tutorials. 3 Basic Calculations. PS 12a Laboratory 1 Spring 2014 PS 12a Laboratory 1 Spring 2014 Objectives This session is a tutorial designed to a very quick overview of some of the numerical skills that you ll need to get started. Throughout the tutorial, the instructors

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

Matlab Programming Introduction 1 2

Matlab Programming Introduction 1 2 Matlab Programming Introduction 1 2 Mili I. Shah August 10, 2009 1 Matlab, An Introduction with Applications, 2 nd ed. by Amos Gilat 2 Matlab Guide, 2 nd ed. by D. J. Higham and N. J. Higham Starting Matlab

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

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

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

More information

2 A little on Spreadsheets

2 A little on Spreadsheets 2 A little on Spreadsheets Spreadsheets are computer versions of an accounts ledger. They are used frequently in business, but have wider uses. In particular they are often used to manipulate experimental

More information

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

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

More information

Introduction to MatLab. Introduction to MatLab K. Craig 1

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

More information

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

Computer Programming in MATLAB

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

More information

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

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

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS

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

More information

MATLAB Workshop Dr. M. T. Mustafa Department of Mathematical Sciences. Introductory remarks

MATLAB Workshop Dr. M. T. Mustafa Department of Mathematical Sciences. Introductory remarks MATLAB Workshop Dr. M. T. Mustafa Department of Mathematical Sciences Introductory remarks MATLAB: a product of mathworks www.mathworks.com MATrix LABoratory What can we do (in or ) with MATLAB o Use like

More information

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

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

More information

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

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

AMS 27L LAB #1 Winter 2009

AMS 27L LAB #1 Winter 2009 AMS 27L LAB #1 Winter 2009 Introduction to MATLAB Objectives: 1. To introduce the use of the MATLAB software package 2. To learn elementary mathematics in MATLAB Getting Started: Log onto your machine

More information

Exploring extreme weather with Excel - The basics

Exploring extreme weather with Excel - The basics Exploring extreme weather with Excel - The basics These activities will help to develop your data skills using Excel and explore extreme weather in the UK. This activity introduces the basics of using

More information

Introduction to MATLAB for Engineers, Third Edition

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

More information

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

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

More information

ARRAY VARIABLES (ROW VECTORS)

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

More information

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

Variables are used to store data (numbers, letters, etc) in MATLAB. There are a few rules that must be followed when creating variables in MATLAB:

Variables are used to store data (numbers, letters, etc) in MATLAB. There are a few rules that must be followed when creating variables in MATLAB: Contents VARIABLES... 1 Storing Numerical Data... 2 Limits on Numerical Data... 6 Storing Character Strings... 8 Logical Variables... 9 MATLAB S BUILT-IN VARIABLES AND FUNCTIONS... 9 GETTING HELP IN MATLAB...

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

Lecturer: Keyvan Dehmamy

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

More information

Introduction to MATLAB 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

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

Chapter 2. MATLAB Fundamentals

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

More information

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

Mathworks (company that releases Matlab ) documentation website is:

Mathworks (company that releases Matlab ) documentation website is: 1 Getting Started The Mathematics Behind Biological Invasions Introduction to Matlab in UNIX Christina Cobbold and Tomas de Camino Beck as modified for UNIX by Fred Adler Logging in: This is what you do

More information

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

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

More information

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

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

More information

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

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

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

Create your first workbook

Create your first workbook Create your first workbook You've been asked to enter data in Excel, but you've never worked with Excel. Where do you begin? Or perhaps you have worked in Excel a time or two, but you still wonder how

More information

MATLAB Introduction to MATLAB Programming

MATLAB Introduction to MATLAB Programming MATLAB Introduction to MATLAB Programming MATLAB Scripts So far we have typed all the commands in the Command Window which were executed when we hit Enter. Although every MATLAB command can be executed

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

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

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

More information

A General Introduction to Matlab

A General Introduction to Matlab Master Degree Course in ELECTRONICS ENGINEERING http://www.dii.unimore.it/~lbiagiotti/systemscontroltheory.html A General Introduction to Matlab e-mail: luigi.biagiotti@unimore.it http://www.dii.unimore.it/~lbiagiotti

More information

Specific Objectives Students will understand that that the family of equation corresponds with the shape of the graph. Students will be able to create a graph of an equation by plotting points. In lesson

More information

Introduction to the workbook and spreadsheet

Introduction to the workbook and spreadsheet Excel Tutorial To make the most of this tutorial I suggest you follow through it while sitting in front of a computer with Microsoft Excel running. This will allow you to try things out as you follow along.

More information

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

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

More information

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

BEGINNER PHP Table of Contents

BEGINNER PHP Table of Contents Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing

More information

EXCEL 98 TUTORIAL Chemistry C2407 fall 1998 Andy Eng, Columbia University 1998

EXCEL 98 TUTORIAL Chemistry C2407 fall 1998 Andy Eng, Columbia University 1998 Created on 09/02/98 11:58 PM 1 EXCEL 98 TUTORIAL Chemistry C2407 fall 1998 Andy Eng, Columbia University 1998 Note for Excel 97 users: All features of Excel 98 for Macintosh are available in Excel 97 for

More information

Objectives. 1 Basic Calculations. 2 Matrix Algebra. Physical Sciences 12a Lab 0 Spring 2016

Objectives. 1 Basic Calculations. 2 Matrix Algebra. Physical Sciences 12a Lab 0 Spring 2016 Physical Sciences 12a Lab 0 Spring 2016 Objectives This lab is a tutorial designed to a very quick overview of some of the numerical skills that you ll need to get started in this class. It is meant to

More information

Excel Spreadsheets and Graphs

Excel Spreadsheets and Graphs Excel Spreadsheets and Graphs Spreadsheets are useful for making tables and graphs and for doing repeated calculations on a set of data. A blank spreadsheet consists of a number of cells (just blank spaces

More information

Excel R Tips. is used for multiplication. + is used for addition. is used for subtraction. / is used for division

Excel R Tips. is used for multiplication. + is used for addition. is used for subtraction. / is used for division Excel R Tips EXCEL TIP 1: INPUTTING FORMULAS To input a formula in Excel, click on the cell you want to place your formula in, and begin your formula with an equals sign (=). There are several functions

More information

Iteration. The final line is simply ending the do word in the first line. You can put as many lines as you like in between the do and the end do

Iteration. The final line is simply ending the do word in the first line. You can put as many lines as you like in between the do and the end do Intruction Iteration Iteration: the for loop Computers are superb at repeating a set of instructions over and over again - very quickly and with complete reliability. Here is a short maple program ce that

More information

Lab#1: INTRODUCTION TO DERIVE

Lab#1: INTRODUCTION TO DERIVE Math 111-Calculus I- Fall 2004 - Dr. Yahdi Lab#1: INTRODUCTION TO DERIVE This is a tutorial to learn some commands of the Computer Algebra System DERIVE. Chapter 1 of the Online Calclab-book (see my webpage)

More information

Lab 1 Intro to MATLAB and FreeMat

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

More information

Section 1: Numerical Calculations

Section 1: Numerical Calculations Section 1: Numerical Calculations In this section you will use Maple to do some standard numerical calculations. Maple's ability to produce exact answers in addition to numerical approximations gives you

More information

ELEN E3084: Signals and Systems Lab Lab II: Introduction to Matlab (Part II) and Elementary Signals

ELEN E3084: Signals and Systems Lab Lab II: Introduction to Matlab (Part II) and Elementary Signals ELEN E384: Signals and Systems Lab Lab II: Introduction to Matlab (Part II) and Elementary Signals 1 Introduction In the last lab you learn the basics of MATLAB, and had a brief introduction on how vectors

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

Starting a New Matlab m.file. Matlab m.files. Matlab m.file Editor/Debugger. The clear all Command. Our Program So Far

Starting a New Matlab m.file. Matlab m.files. Matlab m.file Editor/Debugger. The clear all Command. Our Program So Far Matlab m.files It is not very convenient to do work directly in the Matlab Command Line Window since: It is hard to remember what we typed. It is hard to edit. It all disappears when we close Matlab. Solution:

More information

Green Globs And Graphing Equations

Green Globs And Graphing Equations Green Globs And Graphing Equations Green Globs and Graphing Equations has four parts to it which serve as a tool, a review or testing device, and two games. The menu choices are: Equation Plotter which

More information

An Introduction to Numerical Methods

An Introduction to Numerical Methods An Introduction to Numerical Methods Using MATLAB Khyruddin Akbar Ansari, Ph.D., P.E. Bonni Dichone, Ph.D. SDC P U B L I C AT I O N S Better Textbooks. Lower Prices. www.sdcpublications.com Powered by

More information

ELEMENTARY MATLAB PROGRAMMING

ELEMENTARY MATLAB PROGRAMMING 1 ELEMENTARY MATLAB PROGRAMMING (Version R2013a used here so some differences may be encountered) COPYRIGHT Irving K. Robbins 1992, 1998, 2014, 2015 All rights reserved INTRODUCTION % It is assumed the

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

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

Functions and Graphs. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996.

Functions and Graphs. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996. Functions and Graphs The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996. Launch Mathematica. Type

More information

A GUIDE FOR USING MATLAB IN COMPUTER SCIENCE AND COMPUTER ENGINEERING TABLE OF CONTENTS

A GUIDE FOR USING MATLAB IN COMPUTER SCIENCE AND COMPUTER ENGINEERING TABLE OF CONTENTS A GUIDE FOR USING MATLAB IN COMPUTER SCIENCE AND COMPUTER ENGINEERING MARC THOMAS AND CHRISTOPHER PASCUA TABLE OF CONTENTS 1. Language Usage and Matlab Interface 1 2. Matlab Global Syntax and Semantic

More information