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

Size: px
Start display at page:

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

Transcription

1 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 provides a single platform for computation, visualization, programming and software development. All problems and solutions in MATLAB are in a notation very similar to the way mathematics is written. In addition, you can use MATLAB to build Graphical User Interfaces (GUIs) so that you can develop user-friendly custom software. MATLAB is widely used in all areas of applied mathematics in education and research at universities and in industry. MATLAB is a great tool for solving a wide variety of problems in science, engineering, and finance. In addition, MATLAB has powerful graphic tools and can produce nice pictures in both 2D and 3D. It is also a programming language (similar to C) and is one of the easiest programming languages for writing mathematical programs. Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below. This is where you enter commands. The MATLAB environment consists of menus, buttons and a writing area similar to an ordinary word processor. There are plenty of help functions that you are encouraged to use. The writing area that you will see when you start MATLAB, is called the command window. In this window you give the commands to MATLAB. For example, when you want to enter a command or run a program you have written for MATLAB you start in the command window by typing its name after the prompt. (MATLAB s prompt is >>.) Once you have typed the command you wish MATLAB to perform, press Enter. The command window is also useful if you just want to use MATLAB as a scientific calculator or as a graphing tool. Quitting MATLAB: To quit MATLAB, at a MATLAB prompt type command quit or exit, then press Enter.

2 Using MATLAB as a (scientific) calculator MATLAB s computational engine uses (about) 15 decimal digits in computations (unless directed to do otherwise). So it can be used as a powerful calculator for arithmetic expressions and the calculation of values of function expressions. Arithmetic Operations MATLAB command + (addition) + a + b - (subtraction) - a - b x (multiplication) * a*b (a times b) / (division) / a/b, b 0 ^ (exponentiation) ^ a^b (a raised to the b power a b ) WARNING: You must indicate multiplication using the *. Examples: In expressions it good practice to use parentheses as illustrated below. This is particularly important for fractions which are used in MATLAB. MATLAB expressions Value shown in format long e Value in format short ( )*(9/3.1) e ( )^(1/2) e ( )/( ) e In MATLAB you can control how a numerical value is displayed by using what are called format commands. After a MATLAB prompt type command format long e or format short to get the displays above. Other such commands are format long and format short e. The number π (pi) in MATLAB can be accessed by using the name pi. Here is what is displayed for π in various formats. Format short display for pi Format long display for pi Format short e display for pi e+000 Format long e display for pi e+000 Note that the e formats display in scientific notation; e+002 means Also note that the last decimal digit in a short display is obtained by rounding. Regardless of the display format used to show values on the screen computations are done with 15 digit arithmetic. Use command help format for the description of other display formats. Special case: A value which is exactly zero will be displayed as a single zero. If you see , the value is not exactly zero. Change to a long format and re-display it.

3 Illustrations of ALGEBRA Expressions and their MATLAB form. An important convention: Multiplication must use an asterisk Standard Algebra Form 3x 2-5x + 1 2x 3 4 7x x e -x MATLAB Representation 3*x^2-5*x+1 multiplication must be indicated using * and exponents require an ^ (2*x-3)/(4-7*x) the numerator and denominator must be enclosed in parentheses if they are more than 1 term sqrt(x^2+1) or (x^2+1)^.5 or (x^2+1)^(1/2) using sqrt is preferred; fractional exponents must be enclosed in parentheses exp(-x) ln(x) cos 2 (x - π) sin(x) e -2.3x tan(x) log(x) the natural log function is denoted log; log base 10 is denoted log10 cos(x-pi)^2 constant π is denoted pi; all arguments of trig. functions are considered radians sin(x)*exp(-2.3*x) note that the exponent is in parentheses and that we must use * to indicate multiplication abs(tan(x)) the absolute value is denoted by abs; parentheses must be used Matlab has a wide variety of commands for common functions and operations we provide a list of some of the basic commands next.

4 Operators, Elementary Functions, & General Purpose Commands Arithmetic operators. plus + minus - times * power ^ divide \ Relational operators. Equal == Not equal ~= Exponential exp - Exponential. log - Natural logarithm. log10 - Common (base 10) logarithm. log2 - Base 2 logarithm and dissect floating point number. pow2 - Base 2 power and scale floating point number. Less than < Greater than > Less than or equal <= Greater than or equal >= Logical operators. and & or not ~ Trigonometric & Hyperbolic sqrt - Square root. sin - Sine. nextpow2 - Next higher power of 2. sinh - Hyperbolic sine. asin - Inverse sine. Complex asinh - Inverse hyperbolic sine. abs - Absolute value. cos - Cosine. angle - Phase angle. cosh - Hyperbolic cosine. complex - Construct complex data acos - Inverse cosine. from real and imaginary parts. acosh - Inverse hyperbolic cosine. conj - Complex conjugate. tan - Tangent. imag - Complex imaginary part. tanh - Hyperbolic tangent. real - Complex real part. atan - Inverse tangent. atan2 - Four quadrant inverse tangent. Calculus Operators diff -Difference and approximate atanh - Inverse hyperbolic tangent. derivative when working on a vector. sec - Secant. diff -Differentiate when working on a sech - Hyperbolic secant. string or symbolic expression; will do asec - Inverse secant. higher derivatives & partial asech - Inverse hyperbolic secant. derivatives. csc - Cosecant. int -Integrate; indefinite or definite csch - Hyperbolic cosecant. depending upon the arguments. acsc - Inverse cosecant. taylor -Taylor series expansion. acsch - Inverse hyperbolic cosecant. cot - Cotangent. Basic Plotting Tools coth - Hyperbolic cotangent. acot - Inverse cotangent. plot -Plots a set of ordered pairs. acoth - Inverse hyperbolic cotangent. plot3 -Plots a set of ordered triples. ezplot -Easy to use function plotter.

5 General Purpose Commands home -Moves the cursor to the upper left corner of the Command Window and clears the visible portion of the window. You can use the scroll bar to see what was on the screen previously. clc - Clear command window; scrollbar not available. demo - Run demonstrations. who - List current variables. whos - List current variables, long form. clear - Clear variables and functions from memory. load - Load workspace variables from disk. save - Save workspace variables to disk. saveas - Save Figure or model to desired output format. quit - Quit MATLAB session. exit - Exit from MATLAB. what - List MATLAB-specific files in directory. type - List M-file. which - Locate functions and files. path - Get/set search path. addpath - Add directory to search path. rmpath - Remove directory from search path. diary - Save text of MATLAB session. Diary File: At times you will need to record the results of your MATLAB session as part of an assignment. Have a flash drive ready to use so you can save your MATLAB work. Method 1: Change the Current Directory field in the desktop toolbar to the drive letter associated with the flash drive. You can also use the name of a folder on the flash drive. Now type command diary filename.txt followed by the Enter key. Each computation (but not graphics) you make in MATLAB will be saved in your directory in a text file named filename.txt. Method 2: Use a path name to the flash drive. Example: diary f:\numanalhw\section2_1problem2 This saves things to the f-drive into folder numanalhw using file name section2_1problem2 You can then edit the saved file using your favorite text editor. When you have finished your MATLAB session you can turn off the recording by typing diary off at the MATLAB prompt. If you want to stop your MATLAB session for any reason, you can reopen the diary file the next time you start MATLAB. If you use the same file name, the results of your new MATLAB session will be written at the end of the old diary file. You may want to use different names for each session on an assignment, and then merge the files.

6 Calculus operations in MATLAB You can differentiate and integrate functions in MATLAB. The simplest way to do this is to first name the function whose formula is constructed using the rules above and enclosed in single quotes. Examples: f = 3*x^2+2*x-5 g1 = exp(-x)*sin(x) func = sqrt(4*x+x^2) Another way for a user to define functions is by using the inline command. The following is a typical inline function: f = inline('3*x.^2 + 2*x - 5','x') Note that we need to specify the variable. After pressing enter MATLAB displays f = Inline function: f(x) = 3*x.^2 + 2*x - 5 The advantage to using inline is that you can use the name of the function for evaluation. For example to evaluate f at x = 3.6 use command f(3.6) to which MATLAB responds ans = The inline command can also declare functions with several variable or parameters. For example g = inline('cos(2*pi*x + ang)', 'x', ang') After pressing enter MATLAB displays g = Inline function: g(x,ang) = cos(2*pi*x + ang) To compute the first derivative use a command like diff(f) or diff(func) diff(f) gives the result 6*x + 2 diff(func) gives the result (2*x + 4)/(2*(x^2 + 4*x)^(1/2)) To compute the second derivative use a command like diff(f,2) or diff(g1,2) (Note the second argument is a 2. To compute the n th derivative use positive integer n as a second argument.) MATLAB can also compute partial derivatives. Again we use the diff command but we must indicate the variable we want to differentiate with respect to. Example: Define w = x^2*y^3 cos(x+y) then diff(w, y ) computes the partial with respect to y. The result is sin(x + y) + 3*x^2*y^2. To get the mixed partial first with respect to y, then with respect to x use command ww=diff(diff(w,'y'),'x'). The result is cos(x + y) + 6*x*y^2. To integrate or find an antiderivative use the command int. Examples: (using the functions defined above) int(f) gives the result x*(x^2 + x - 5) int(g1) gives the result -(cos(x) + sin(x))/(2*exp(x)) To compute a definite integral over a finite interval we must include the interval in the int command.

7 Example: int(f,-1, 3) gives the numerical result 16. (Here -1 was the lower limit and 3 the upper limit.) To use diff or int on inline functions you must convert it to a character string. For example command char(g) displays g = cos(2*pi*x + ang) and then diff(g) will compute the derivative with respect to x. Plotting equations in MATLAB exp(-x) sin(x) A simple way to plot a function given by a formula is to use the command ezplot. Usually you want to specify an interval for the domain Example: For function g1 = exp(-x)*sin(x) to graph it over -1 [-2, 10] we use command ezplot(g1,[-2,10]). The figure produced is -1.5 By default the title at the top of the graph is the expression for the function. You can change the title. For instance if x you want to put your name on the graph use command title( YOUR NAME ). You can also label the axes using commands xlabel and ylabel in a similar fashion. For example, xlabel( X-Axis ) and ylabel( Vertical Axis ). (Note the use of single quotes.) There are times when you want to graph more than one function on the same set of axes using the same domain [a, b]. To plot two functions, f and g which you have defined previously between single quotes the following set of commands will do the job. ezplot (f, [a,b]) hold on ezplot(g,[a,b]) hold off %<== this command holds the graph so we can plot a second time %<== this command release the graph so new plot can be generated To generate two graphs and have them both be viewable: ezplot (f, [a,b]) figure,ezplot(g,[a,b]) %<== the figure command generates a second graphics window for the second plot If you omit the figure command the second plot will be the only one viewable. A drawback to this approach is that the two curves will be in the same color. To print a graph you have generated use the File drop down menu at the top of the plot.

8 To copy a graph you have generated so you can paste it into a document use the Edit drop down menu. To close or erase all the graphs currently generated us command close all

9 General Information 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 a command. MATLAB is case sensitive; all built-in MATLAB commands are LOWER CASE. There are certain MATLAB features you should be aware of before you begin working with MATLAB. Variables, Expressions and Statements. MATLAB statements typically take one of two forms: variable = expression or an expression Examples val = cos(pi/7) exp(2.13) All variable (and function) names consist of a letter followed by any number of numbers, letters and underscores. MATLAB is case sensitive and only the first 19 characters of any name are significant. The equal sign = is called the assignment operator. Expressions are composed from operators, function calls and variable names. Pressing ENTER normally signifies the end of a statement, causing MATLAB to interpret the command and print its result. If the last character of a statement is a; (semicolon), however, display of the result is suppressed. This feature may be especially useful when the result of a computation is a large matrix. Finally, several statements separated by commas may be placed on a single line. When an expression is not explicitly assigned to a variable with the assignment operator (=), MATLAB automatically stores the result in the special variable ans. During a MATLAB session you may forget the names of variables stored in your workspace. The command who lists the names of all your variables. If you want to know their size as well, use the command whos. By default MATLAB stores all variables until the session is terminated. To remove a variable from the workspace use the command clear var_name. WARNING: clear with no arguments removes all variables from the workspace.

10 Numbers. MATLAB uses conventional decimal notation with an optional decimal point and minus sign for negative values. Scientific notation uses the letter e to specify a power of ten scale factor. Some valid numbers are: 34, -7, , , , e+002. All numbers are stored internally using the long format specified by the IEEE floating point standard. Floating point numbers have about 16 significant decimal digits and a finite range of about to Starting execution of a command. After you have typed a command name and any arguments or data required, you must press ENTER before it will begin to execute. Search Path. To determine how to execute commands MATLAB uses a search path to find m-files and other data sets. Any file you want to execute must reside in the current directory or in a folder that is on the search path. By default, the files supplied with MATLAB and MathWorks toolboxes are included in the search path. To see which directories/folders are on the search path type the command path. To change the search path select Set Path from the File menu in the desktop, and use the Set Path dialog box. The command addpath can be used to add directories to the path, and command rmpath can be used to remove directories from the path, Getting help. If you know the name of command >> help sin typing help followed by the name SIN Sine of argument in radians. displays information about the SIN(X) is the sine of the elements of X. command. >> help sqrt SQRT Square root. SQRT(X) is the square root of the elements of X. Complex results are produced if X is not positive. The command stack. As you enter commands, MATLAB saves a number of the most recent commands in a stack. Previous commands saved on the stack can be recalled using the up arrow key. The number of commands saved on the stack varies depending on the length of the commands and other factors. Editing commands. If you make an error or mistype something in a command, you can use the left arrow and right arrow keys to position the cursor for corrections. The home key moves the cursor to the beginning of a command, and the end key moves the cursor to the end. The backspace and delete keys can be used to remove characters from a command line. The insert key is used to initiate the insertion of characters. Pressing the insert key a second time exits the insert mode. If MATLAB recognizes an error after you have pressed ENTER, then MATLAB responds with a beep and a message that helps define the error. You can recall the command line using the up arrow key in order to edit the line. To delete an entire command line press ESC, escape.

11 Continuing commands. MATLAB commands that do not fit on a single line can be continued to the next line using an ellipsis, which is three consecutive periods, followed by ENTER. Stopping a command. To stop execution of a MATLAB command, press Ctrl and C simultaneously, then press ENTER. Sometimes this sequence must be repeated. Suppressing Displays: When you place a semicolon at the end of a command, the command will be executed but the result will not be displayed on the screen. This is very useful when you do not want to reveal intermediate steps of a calculation. Try typing the command w = linspace(1,20,100); Note the semicolon to create a row vector with equally spaced entries. The contents of w will not be displayed. To see the contents just type w. To enter a string: type the contents of the string between single quotes '... ' command st = 'Hi there. ' displays st = Hi there. Strings are not commands. Strings supply information. Strings are used for messages and for formulas as previously illustrated.

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

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

General Information. There are certain MATLAB features you should be aware of before you begin working with MATLAB.

General Information. There are certain MATLAB features you should be aware of before you begin working with MATLAB. Introduction to MATLAB 1 General Information 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 a

More information

Introduction to Scientific and Engineering Computing, BIL108E. Karaman

Introduction to Scientific and Engineering Computing, BIL108E. Karaman USING MATLAB INTRODUCTION TO SCIENTIFIC & ENGINEERING COMPUTING BIL 108E, CRN24023 To start from Windows, Double click the Matlab icon. To start from UNIX, Dr. S. Gökhan type matlab at the shell prompt.

More information

Introduction to MATLAB

Introduction to MATLAB Outlines September 9, 2004 Outlines Part I: Review of Previous Lecture Part II: Part III: Writing MATLAB Functions Review of Previous Lecture Outlines Part I: Review of Previous Lecture Part II: Part III:

More information

Introduction to MATLAB

Introduction to MATLAB Outlines January 30, 2008 Outlines Part I: Part II: Writing MATLAB Functions Starting MATLAB Exiting MATLAB Getting Help Command Window Workspace Command History Current Directory Selector Real Values

More information

Script started on Thu 25 Aug :00:40 PM CDT

Script started on Thu 25 Aug :00:40 PM CDT Script started on Thu 25 Aug 2016 02:00:40 PM CDT < M A T L A B (R) > Copyright 1984-2014 The MathWorks, Inc. R2014a (8.3.0.532) 64-bit (glnxa64) February 11, 2014 To get started, type one of these: helpwin,

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

GRAPH 4.4. Megha K. Raman APRIL 22, 2015

GRAPH 4.4. Megha K. Raman APRIL 22, 2015 GRAPH 4.4 By Megha K. Raman APRIL 22, 2015 1. Preface... 4 2. Introduction:... 4 3. Plotting a function... 5 Sample funtions:... 9 List of Functions:... 10 Constants:... 10 Operators:... 11 Functions:...

More information

A. Matrix-wise and element-wise operations

A. Matrix-wise and element-wise operations USC GSBME MATLAB CLASS Reviewing previous session Second session A. Matrix-wise and element-wise operations A.1. Matrix-wise operations So far we learned how to define variables and how to extract data

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

Ebooks Chemical Engineering

Ebooks Chemical Engineering Uploaded by: Ebooks Chemical Engineering https://www.facebook.com/pages/ebooks-chemical-engineering/238197077030 For More Books, softwares & tutorials Related to Chemical Engineering Join Us @facebook:

More information

Matlab Workshop I. Niloufer Mackey and Lixin Shen

Matlab Workshop I. Niloufer Mackey and Lixin Shen Matlab Workshop I Niloufer Mackey and Lixin Shen Western Michigan University/ Syracuse University Email: nil.mackey@wmich.edu, lshen03@syr.edu@wmich.edu p.1/13 What is Matlab? Matlab is a commercial Matrix

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

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

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

Introduction to Engineering gii

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

More information

Matlab 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

The Graphing Calculator

The Graphing Calculator Chapter 23 The Graphing Calculator To display the calculator, select Graphing Calculator from the Window menu. The calculator is displayed in front of the other windows. Resize or re-position the Graphing

More information

Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017

Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017 Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017 Appendix A Glossary of Matlab Commands Mathematical Operations + Addition. Type help plus

More information

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

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

More information

Matlab as a calculator

Matlab as a calculator Why Matlab? Matlab is an interactive, high-level, user-friendly programming and visualization environment. It allows much faster programs development in comparison with the traditional low-level compiled

More information

Programming in MATLAB

Programming in MATLAB trevor.spiteri@um.edu.mt http://staff.um.edu.mt/trevor.spiteri Department of Communications and Computer Engineering Faculty of Information and Communication Technology University of Malta 17 February,

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

MATLAB The first steps. Edited by Péter Vass

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

More information

Graphing Calculator Tutorial

Graphing Calculator Tutorial Graphing Calculator Tutorial This tutorial is designed as an interactive activity. The best way to learn the calculator functions will be to work the examples on your own calculator as you read the tutorial.

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

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

POLYMATH POLYMATH. for IBM and Compatible Personal Computers. for IBM and Compatible Personal Computers

POLYMATH POLYMATH. for IBM and Compatible Personal Computers. for IBM and Compatible Personal Computers POLYMATH VERSION 4.1 Provides System Printing from Windows 3.X, 95, 98 and NT USER-FRIENDLY NUMERICAL ANALYSIS PROGRAMS - SIMULTANEOUS DIFFERENTIAL EQUATIONS - SIMULTANEOUS ALGEBRAIC EQUATIONS - SIMULTANEOUS

More information

Section 5.3 Graphs of the Cosecant and Secant Functions 1

Section 5.3 Graphs of the Cosecant and Secant Functions 1 Section 5.3 Graphs of the Cosecant, Secant, Tangent, and Cotangent Functions The Cosecant Graph RECALL: 1 csc x so where sin x 0, csc x has an asymptote. sin x To graph y Acsc( Bx C) D, first graph THE

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

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

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Brett Ninness Department of Electrical and Computer Engineering The University of Newcastle, Australia. The name MATLAB is a sort of acronym for Matrix Laboratory. In fact, MATLAB

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

The Official Guide to Easy Graphing. ParaGraph. Ver Congratulations Graphing just got easier.

The Official Guide to Easy Graphing. ParaGraph. Ver Congratulations Graphing just got easier. The Official Guide to Easy Graphing ParaGraph Ver. 6.5.1 Congratulations Graphing just got easier. Here s to putting a parametric grapher in your hands. Vande Burgt Productions Visual Basic Gadgets 3/3/2012

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

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

Chapter 1 MATLAB Preliminaries

Chapter 1 MATLAB Preliminaries Chapter 1 MATLAB Preliminaries 1.1 INTRODUCTION MATLAB (Matrix Laboratory) is a high-level technical computing environment developed by The Mathworks, Inc. for mathematical, scientific, and engineering

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

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

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

A very short introduction to Matlab and Octave

A very short introduction to Matlab and Octave A very short introduction to Matlab and Octave Claude Fuhrer (claude.fuhrer@bfh.ch) 09 November 2016 Contents 1 Installation 3 2 Variables and literal values 3 2.1 Variables....................................

More information

Built-in Types of Data

Built-in Types of Data Built-in Types of Data Types A data type is set of values and a set of operations defined on those values Python supports several built-in data types: int (for integers), float (for floating-point numbers),

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

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

Lecture 7 Symbolic Computations

Lecture 7 Symbolic Computations Lecture 7 Symbolic Computations The focus of this course is on numerical computations, i.e. calculations, usually approximations, with floating point numbers. However, Matlab can also do symbolic computations,

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

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

Introduction to GNU-Octave

Introduction to GNU-Octave Introduction to GNU-Octave Dr. K.R. Chowdhary, Professor & Campus Director, JIETCOE JIET College of Engineering Email: kr.chowdhary@jietjodhpur.ac.in Web-Page: http://www.krchowdhary.com July 11, 2016

More information

MATLAB QUICK START TUTORIAL

MATLAB QUICK START TUTORIAL MATLAB QUICK START TUTORIAL This tutorial is a brief introduction to MATLAB which is considered one of the most powerful languages of technical computing. In the following sections, the basic knowledge

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

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

# Import constants pi2, pip2, pip4 (2*pi, pi/2, pi/4). use Math::Trig ':pi';

# Import constants pi2, pip2, pip4 (2*pi, pi/2, pi/4). use Math::Trig ':pi'; NAME Math::Trig - trigonometric functions SYNOPSIS use Math::Trig; $x = tan(0.9); $y = acos(3.7); $z = asin(2.4); $halfpi = pi/2; $rad = deg2rad(120); # Import constants pi2, pip2, pip4 (2*pi, pi/2, pi/4).

More information

Consider this m file that creates a file that you can load data into called rain.txt

Consider this m file that creates a file that you can load data into called rain.txt SAVING AND IMPORTING DATA FROM A DATA FILES AND PROCESSING AS A ONE DIMENSIONAL ARRAY If we save data in a file sequentially than we can call it back sequentially into a row vector. Consider this m file

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

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 Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY

MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY What is MATLAB? MATLAB (MATrix LABoratory) developed by The Mathworks, Inc. (http://www.mathworks.com) Key Features: High-level language for numerical

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

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

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

9 Using Equation Networks

9 Using Equation Networks 9 Using Equation Networks In this chapter Introduction to Equation Networks 244 Equation format 247 Using register address lists 254 Setting up an enable contact 255 Equations displayed within the Network

More information

A Brief Introduction to MATLAB

A Brief Introduction to MATLAB A Brief Introduction to MATLAB MATLAB (Matrix Laboratory) is an interactive software system for numerical computations and graphics. As the name suggests, MATLAB was first designed for matrix computations:

More information

Welcome. Please Sign-In

Welcome. Please Sign-In Welcome Please Sign-In Day 1 Session 1 Self-Evaluation Topics to be covered: Equations Systems of Equations Solving Inequalities Absolute Value Equations Equations Equations An equation says two things

More information

Introduction to MATLAB

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

More information

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

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

More information

Introduction to Classic Maple by David Maslanka

Introduction to Classic Maple by David Maslanka Introduction to Classic Maple by David Maslanka Maple is a computer algebra system designed to do mathematics. Symbolic, numerical and graphical computations can all be done with Maple. Maple's treatment

More information

ANSI C Programming Simple Programs

ANSI C Programming Simple Programs ANSI C Programming Simple Programs /* This program computes the distance between two points */ #include #include #include main() { /* Declare and initialize variables */ double

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 Eugeniy E. Mikhailov The College of William & Mary Lecture 02 Eugeniy Mikhailov (W&M) Practical Computing Lecture 02 1 / 27 Matlab variable types Eugeniy Mikhailov (W&M) Practical

More information

Julia Calculator ( Introduction)

Julia Calculator ( Introduction) Julia Calculator ( Introduction) Julia can replicate the basics of a calculator with the standard notations. Binary operators Symbol Example Addition + 2+2 = 4 Substraction 2*3 = 6 Multify * 3*3 = 9 Division

More information

Introduction to MATLAB

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

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Dr./ Ahmed Nagib Mechanical Engineering department, Alexandria university, Egypt Sep 2015 Chapter 5 Functions Getting Help for Functions You can use the lookfor command to find functions

More information

Introduction to Matlab. Matlab variable types. Matlab variable types. Matlab variable types. Notes. Eugeniy E. Mikhailov. Lecture 02. Notes.

Introduction to Matlab. Matlab variable types. Matlab variable types. Matlab variable types. Notes. Eugeniy E. Mikhailov. Lecture 02. Notes. Introduction to Matlab Eugeniy E. Mikhailov The College of William & Mary Lecture 02 Eugeniy Mikhailov (W&M) Practical Computing Lecture 02 1 / 26 Matlab variable types Eugeniy Mikhailov (W&M) Practical

More information

Welcome to EGR 106 Foundations of Engineering II

Welcome to EGR 106 Foundations of Engineering II Welcome to EGR 106 Foundations of Engineering II Course information Today s specific topics: Computation and algorithms MATLAB Basics Demonstrations Material in textbook chapter 1 Computation What is computation?

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

Precalculus: Graphs of Tangent, Cotangent, Secant, and Cosecant Practice Problems. Questions

Precalculus: Graphs of Tangent, Cotangent, Secant, and Cosecant Practice Problems. Questions Questions 1. Describe the graph of the function in terms of basic trigonometric functions. Locate the vertical asymptotes and sketch two periods of the function. y = 3 tan(x/2) 2. Solve the equation csc

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

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

MATLAB: a Brief Introduction. by Robert L. Rankin

MATLAB: a Brief Introduction. by Robert L. Rankin MATLAB: a Brief Introduction by Robert L. Rankin Spring 1996 R.1 Introduction to MATLAB MATLAB: a Brief Introduction MATLAB is an acronym for MATrix LABoratory and is a highly optimized numerical computation

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

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

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

EE 350. Continuous-Time Linear Systems. Recitation 1. 1

EE 350. Continuous-Time Linear Systems. Recitation 1. 1 EE 350 Continuous-Time Linear Systems Recitation 1 Recitation 1. 1 Recitation 1 Topics MATLAB Programming Basic Operations, Built-In Functions, and Variables m-files Graphics: 2D plots EE 210 Review Branch

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Basics MATLAB is a high-level interpreted language, and uses a read-evaluate-print loop: it reads your command, evaluates it, then prints the answer. This means it works a lot like

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

Finding, Starting and Using Matlab

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

More information

Introduction to Computer Programming in Python Dr. William C. Bulko. Data Types

Introduction to Computer Programming in Python Dr. William C. Bulko. Data Types Introduction to Computer Programming in Python Dr William C Bulko Data Types 2017 What is a data type? A data type is the kind of value represented by a constant or stored by a variable So far, you have

More information

AP Calculus Summer Review Packet

AP Calculus Summer Review Packet AP Calculus Summer Review Packet Name: Date began: Completed: **A Formula Sheet has been stapled to the back for your convenience!** Email anytime with questions: danna.seigle@henry.k1.ga.us Complex Fractions

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

INTRODUCTION TO MATLAB. Padmanabhan Seshaiyer

INTRODUCTION TO MATLAB. Padmanabhan Seshaiyer INTRODUCTION TO MATLAB First Steps You should start MATLAB by simply typing matlab if you are working on a Unix system or just by double clicking the MATLAB icon if you are using a Windows based system.

More information

Matlab Introduction. Scalar Variables and Arithmetic Operators

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

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Department of Computer Science and Information Systems Tingting Han (afternoon), Steve Maybank (evening) tingting@dcs.bbk.ac.uk sjmaybank@dcs.bbk.ac.uk Autumn 2017 Week 4: More

More information

Graphics calculator instructions

Graphics calculator instructions Graphics calculator instructions Contents: A B C D E F G Basic calculations Basic functions Secondary function and alpha keys Memory Lists Statistical graphs Working with functions 10 GRAPHICS CALCULATOR

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

10 Using the PCFL Editor In this chapter

10 Using the PCFL Editor In this chapter 10 Using the PCFL Editor In this chapter Introduction to the PCFL editor 260 Editing PCFL registers 261 Customizing the PCFL configuration file 272 ProWORX NxT User s Guide Introduction to the PCFL editor

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

Lesson #3. Variables, Operators, and Expressions. 3. Variables, Operators and Expressions - Copyright Denis Hamelin - Ryerson University

Lesson #3. Variables, Operators, and Expressions. 3. Variables, Operators and Expressions - Copyright Denis Hamelin - Ryerson University Lesson #3 Variables, Operators, and Expressions Variables We already know the three main types of variables in C: int, char, and double. There is also the float type which is similar to double with only

More information

MAT 275 Laboratory 1 Introduction to MATLAB

MAT 275 Laboratory 1 Introduction to MATLAB MATLAB sessions: Laboratory 1 1 MAT 275 Laboratory 1 Introduction to MATLAB MATLAB is a computer software commonly used in both education and industry to solve a wide range of problems. This Laboratory

More information

Digital Image Analysis and Processing CPE

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

More information

Graphing Calculator Scientific Calculator Version 2.0

Graphing Calculator Scientific Calculator Version 2.0 Graphing Calculator Scientific Calculator Version 2.0 www.infinitysw.com/ets March 14, 2017 1 Table of Contents Table of Contents 1 Overview 3 2 Navigation 4 3 Using the Calculator 5 Display 5 Performing

More information