Vectors, Arrays and Functions

Size: px
Start display at page:

Download "Vectors, Arrays and Functions"

Transcription

1 Vectors, Arrays and Functions Richard Sonnenfeld (with some material from W. Palm) Vectors Physics definition Use in Matlab Concept of an Array User Defined Functions Conditional statements <9/6/2007> Page 1

2 Matlab can easily represent vectors as defined in the classical physics sense. The vector r can be specified by three components: x, y, and z, and can be written as: r r = [x, y, z]. However, MATLAB can use vectors having more than three elements. <9/6/2007> Page 2

3 To create a row vector, separate the elements by commas. For example, >>p = [3,7,9] p = You can create a column vector by using the transpose notation ('). Or by separating the elements by semicolons. For example, >>p = [3,7,9]' p = >>g = [3;7;9] g = <9/6/2007> Page 3

4 You can create vectors by ''appending'' one vector to another. For example, if >> r = [2,4,20] and >> w = [9,-6,3], Then >> u = [r,w]. The result is the vector u = [2,4,20,9,-6,3]. You can also create a subset of a vector. Assume we wanted to use the 2 nd, 3 rd, and 4 th elements of u. How could this be done? <9/6/2007> Page 4

5 The colon operator (:) easily generates a large vector of regularly spaced elements. Typing >>x = [m:q:n] creates a vector x of values with a spacing q. The first value is m. The last value is n if m - n is an integer multiple of q. If not, the last value is less than n. <9/6/2007> Page 5

6 For example >> x = [0:2:8] x = [0,2,4,6,8] >> x = [0:2:7] x = [0,2,4,6] To create row vector z consisting of the values from 5 to 8 in steps of 0.1, type z = [5:0.1:8]. If the increment q is omitted, then q=1. y = [-3:2] y = [-3,-2,-1,0,1,2]. <9/6/2007> Page 6

7 The linspace command also creates a linearly spaced row vector, but instead you specify the number of values rather than the increment. The syntax is linspace(x1,x2,n), where x1 and x2 are the lower and upper limits and n is the number of points. For example, linspace(5,8,31) is equivalent to [5:0.1:8]. If n is omitted, the spacing is 1. Example: t=linspace(0,5);x=3*t-4.9*t.^2;plot(t,x) <9/6/2007> Page 7

8 Potential confusion Matlab flexibly and cleverly handles row and column vectors and matrices of different sizes. Most operations are defined on vectors or matrices of the same size. For example, adding a row vector to a column vector causes an error. >> a=[0:10]; b=a +7; c=a+b??? Error using ==> + Matrix dimensions must agree. Get used to looking for these they are one of the most common causes of strange behavior. <9/6/2007> Page 8

9 Programming concept called Array Array (noun) In programming languages, a name given to sequences of variables that have a relationship to eachother. Examples: Successive points in a scientific data set. Adjacent values of a mathematical function. Successive array elements are often allocated physically adjacent locations in computer memory. In Matlab, arrays are referred to as Vectors or Matrices. <9/6/2007> Page 9

10 Vectors and relative motion The linspace command also creates a linearly spaced row vector, but instead you specify the number of values rather than the increment. The syntax is linspace(x1,x2,n), where x1 and x2 are the lower and upper limits and n is the number of points. For example, linspace(5,8,31) is equivalent to [5:0.1:8]. If n is omitted, the spacing is 1. Example: t=linspace(0,5);x=3*t-4.9*t.^2;plot(t,x) <9/6/2007> Page 10

11 Magnitude, Length, and Absolute Value of a Vector In physics, length, magnitude and absolute value of a vector all mean the same thing. In Matlab, they do not. Magnitude of a vector x having elements x 1, x 2,, x n is a scalar, given by (x x x n2 ), and is the same as the physics definition of magnitude. length command gives the number of elements in the vector. The absolute value of a vector x is a vector whose elements are the absolute values of the elements of x. <9/6/2007> Page 11

12 For example: >> x = [2,-4,5] its length is 3 (length(x)) its magnitude is [2 2 + ( 4) ] = (sqrt(x *x)) its absolute value is [2,4,5] (abs(x)). <9/6/2007> Page 12

13 Matrices A matrix has multiple rows and columns. For example, the matrix M = has four rows and three columns. Vectors are special cases of matrices having one row or one column. <9/6/2007> Page 13

14 Creating Matrices from Vectors Suppose a =[1,3,5] and b = [7,9,11] (row vectors). Note the difference between the results given by [a b] and [a;b] in the following session: >>c = [a b]; c = >> D = [[1,3,5];[7,9,11]] alternatively >>D = [a;b] D = <9/6/2007> Page 14

15 Array Addressing The colon operator selects individual elements, rows, columns, or ''subarrays'' of arrays. Examples: v(:) represents all the elements of the vector v. v(2:5) represents the second through fifth elements; that is v(2), v(3), v(4), v(5). A(:,3) denotes all the elements in the third column of the matrix A. A(:,2:5) denotes all the elements in the second through fifth columns of A. A(3,:) denotes all the elements in the third row <9/6/2007> Page 15

16 You can use array indices to extract a smaller array from another array. For example, if you first create the array B B = then type C = B(2:3,1:3), you can produce the following array: C = <9/6/2007> Page 16

17 Additional Array Functions size(a) Returns a row vector [m n] containing the sizes of the m x n array A. sort(a) Sorts each column of the array A in ascending order and returns an array the same size as A. sum(a) Sums the elements in each column of the array A and returns a row vector containing the sums. max(a)? <9/6/2007> Page 17

18 The Workspace Browser <9/6/2007> Page 18

19 The Array Editor <9/6/2007> Page 19

20 Element-by-element operations: Table Symbol Operation Form Examples + Scalar-array addition A + b [6,3]+2=[8,5] - Scalar-array subtraction A b [8,3]-5=[3,-2] + Array addition A + B [6,5]+[4,8]=[10,13] - Array subtraction A B [6,5]-[4,8]=[2,-3].* Array multiplication A.*B [3,5].*[4,8]=[12,40]./ Array right division A./B [2,5]./[4,8]=[2/4,5/8].\ Array left division A.\B [2,5].\[4,8]=[2\4,5\8].^ Array exponentiation A.^B [3,5].^2=[3^2,5^2] 2.^[3,5]=[2^3,2^5] [3,5].^[2,4]=[3^2,5^4] <9/6/2007> Page 20

21 User defined functions Richard Sonnenfeld <9/6/2007> Page 21

22 Operations on Arrays MATLAB will treat a variable as an array automatically. For example, to compute the square roots of 5, 7, and 15, type >>x = [5,7,15]; >>y = sqrt(x) y = <9/6/2007> Page 22

23 User-Defined Functions The first line in a function file must begin with a function definition line that has a list of inputs and outputs. This line distinguishes a function M-file from a script M-file. Its syntax is as follows: function [output variables] = name(input variables) Note that the output variables are enclosed in square brackets, while the input variables must be enclosed with parentheses. The function name (here, name) should be the same as the file name in which it is saved (with the.m extension). <9/6/2007> Page 23

24 User-Defined Functions: Example function z = fun(x,y) u = 3*x; z = u + 6*y.^2; Note the use of a semicolon at the end of the lines. This prevents the values of u and z from being displayed. Note also the use of the array exponentiation operator (.^). This enables the function to accept y as an array. <9/6/2007> Page 24

25 User-Defined Functions: Example (continued) Call this function with its output argument: >>z = fun(3,7) z = 303 The function uses x = 3 and y = 7 to compute z. <9/6/2007> Page 25

26 User-Defined Functions: Example (continued) Call this function without its output argument and try to access its value. You will see an error message. >>fun(3,7) ans = 303 >>z??? Undefined function or variable z. <9/6/2007> Page 26

27 User-Defined Functions: Example (continued) Assign the output argument to another variable: >>q = fun(3,7) q = 303 You can suppress the output by putting a semicolon after the function call. For example, if you type q = fun(3,7); the value of q will be computed but not displayed (because of the semicolon). <9/6/2007> Page 27

28 The variables x and y are local to the function fun, so unless you pass their values by naming them x and y, their values will not be available in the workspace outside the function. The variable u is also local to the function. For example, >>x = 3;y = 7; >>q = fun(x,y); >>x x = 3 >>y y = 7 >>u??? Undefined function or variable u. <9/6/2007> Page 28

29 Only the order of the arguments is important, not the names of the arguments: >>x = 7;y = 3; >>z = fun(y,x) z = 303 The second line is equivalent to z = fun(3,7). <9/6/2007> Page 29

30 You can use arrays as input arguments: >>r = fun([2:4],[7:9]) r = <9/6/2007> Page 30

31 A function may have more than one output. These are enclosed in square brackets. For example, the function circle computes the area A and circumference C of a circle, given its radius as an input argument. function [A, C] = circle(r) A = pi*r.^2; C = 2*pi*r; <9/6/2007> Page 31

32 The function is called as follows, if the radius is 4. >>[A, C] = circle(4) A = C = <9/6/2007> Page 32

33 A function may have no input arguments and no output list. For example, the function show_date computes and stores the date in the variable today, and displays the value of today. function show_date today = date <9/6/2007> Page 33

34 Examples of Function Definition Lines 1. One input, one output: function [area_square] = square(side) 2. Brackets are optional for one input, one output: function area_square = square(side) 3. Three inputs, one output: function [volume_box] = box(height,width,length) 4. One input, two outputs: function [area_circle,circumf] = circle(radius) 5. No output: function sqplot(side) <9/6/2007> Page 34

2+2 Just type and press enter and the answer comes up ans = 4

2+2 Just type and press enter and the answer comes up ans = 4 Demonstration Red text = commands entered in the command window Black text = Matlab responses Blue text = comments 2+2 Just type and press enter and the answer comes up 4 sin(4)^2.5728 The elementary functions

More information

(!' ) "' # "*# "!(!' +,

(!' ) ' # *# !(!' +, MATLAB is a numeric computation software for engineering and scientific calculations. The name MATLAB stands for MATRIX LABORATORY. MATLAB is primarily a tool for matrix computations. It was developed

More information

AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables

AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables AMATH 352 Lecture 3 MATLAB Tutorial MATLAB (short for MATrix LABoratory) is a very useful piece of software for numerical analysis. It provides an environment for computation and the visualization. Learning

More information

MATLAB Workshop 3 - Vectors in MATLAB

MATLAB Workshop 3 - Vectors in MATLAB MATLAB: Workshop - Vectors in MATLAB page 1 MATLAB Workshop - Vectors in MATLAB Objectives: Learn about vector properties in MATLAB, methods to create row and column vectors, mathematical functions with

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Social Science Research Lab American University, Washington, D.C. Web. www.american.edu/provost/ctrl/pclabs.cfm Tel. x3862 Email. SSRL@American.edu Course Objective This course provides

More information

Financial Econometrics MFE MATLAB Introduction. Kevin Sheppard University of Oxford

Financial Econometrics MFE MATLAB Introduction. Kevin Sheppard University of Oxford Financial Econometrics MFE MATLAB Introduction Kevin Sheppard University of Oxford October 21, 2013 2007-2013 Kevin Sheppard 2 Contents Introduction i 1 Getting Started 1 2 Basic Input and Operators 5

More information

Beginner s Matlab Tutorial

Beginner s Matlab Tutorial Christopher Lum lum@u.washington.edu Introduction Beginner s Matlab Tutorial This document is designed to act as a tutorial for an individual who has had no prior experience with Matlab. For any questions

More information

How long is the vector? >> length(x) >> d=size(x) % What are the entries in the matrix d?

How long is the vector? >> length(x) >> d=size(x) % What are the entries in the matrix d? MATLAB : A TUTORIAL 1. Creating vectors..................................... 2 2. Evaluating functions y = f(x), manipulating vectors. 4 3. Plotting............................................ 5 4. Miscellaneous

More information

Here are some examples of combining elements and the operations used:

Here are some examples of combining elements and the operations used: MATRIX OPERATIONS Summary of article: What is an operation? Addition of two matrices. Multiplication of a Matrix by a scalar. Subtraction of two matrices: two ways to do it. Combinations of Addition, Subtraction,

More information

MATLAB Basics MATLAB numbers and numeric formats

MATLAB Basics MATLAB numbers and numeric formats MATLAB Basics MATLAB numbers and numeric formats All numerical variables are stored in MATLAB in double precision floating-point form. (In fact it is possible to force some variables to be of other types

More information

Linear Algebra and TI 89

Linear Algebra and TI 89 Linear Algebra and TI 89 Abdul Hassen and Jay Schiffman This short manual is a quick guide to the use of TI89 for Linear Algebra. We do this in two sections. In the first section, we will go over the editing

More information

MATLAB Programming. Problem 1: Sequential

MATLAB Programming. Problem 1: Sequential Division of Engineering Fundamentals, Copyright 1999 by J.C. Malzahn Kampe 1 / 21 MATLAB Programming When we use the phrase computer solution, it should be understood that a computer will only follow directions;

More information

(!' ) "' # "*# "!(!' +,

(!' ) ' # *# !(!' +, Normally, when single line commands are entered, MATLAB processes the commands immediately and displays the results. MATLAB is also capable of processing a sequence of commands that are stored in files

More information

a(1) = first.entry of a

a(1) = first.entry of a Lecture 2 vectors and matrices ROW VECTORS Enter the following in SciLab: [1,2,3] scilab notation for row vectors [8]==8 a=[2 3 4] separate entries with spaces or commas b=[10,10,10] a+b, b-a add, subtract

More information

Matrix Algebra in R A Minimal Introduction

Matrix Algebra in R A Minimal Introduction A Minimal Introduction James H. Steiger Department of Psychology and Human Development Vanderbilt University Regression Modeling, 2009 1 Defining a Matrix in R Entering by Columns Entering by Rows Entering

More information

1 Introduction to Matrices

1 Introduction to Matrices 1 Introduction to Matrices In this section, important definitions and results from matrix algebra that are useful in regression analysis are introduced. While all statements below regarding the columns

More information

MatLab Basics. Now, press return to see what Matlab has stored as your variable x. You should see:

MatLab Basics. Now, press return to see what Matlab has stored as your variable x. You should see: MatLab Basics MatLab was designed as a Matrix Laboratory, so all operations are assumed to be done on matrices unless you specifically state otherwise. (In this context, numbers (scalars) are simply regarded

More information

u = [ 2 4 5] has one row with three components (a 3 v = [2 4 5] has three rows separated by semicolons (a 3 w = 2:5 generates the row vector w = [ 2 3

u = [ 2 4 5] has one row with three components (a 3 v = [2 4 5] has three rows separated by semicolons (a 3 w = 2:5 generates the row vector w = [ 2 3 MATLAB Tutorial You need a small numb e r of basic commands to start using MATLAB. This short tutorial describes those fundamental commands. You need to create vectors and matrices, to change them, and

More information

To Evaluate an Algebraic Expression

To Evaluate an Algebraic Expression 1.5 Evaluating Algebraic Expressions 1.5 OBJECTIVES 1. Evaluate algebraic expressions given any signed number value for the variables 2. Use a calculator to evaluate algebraic expressions 3. Find the sum

More information

Notes on Determinant

Notes on Determinant ENGG2012B Advanced Engineering Mathematics Notes on Determinant Lecturer: Kenneth Shum Lecture 9-18/02/2013 The determinant of a system of linear equations determines whether the solution is unique, without

More information

Linear Algebra Notes for Marsden and Tromba Vector Calculus

Linear Algebra Notes for Marsden and Tromba Vector Calculus Linear Algebra Notes for Marsden and Tromba Vector Calculus n-dimensional Euclidean Space and Matrices Definition of n space As was learned in Math b, a point in Euclidean three space can be thought of

More information

Appendix: Tutorial Introduction to MATLAB

Appendix: Tutorial Introduction to MATLAB Resampling Stats in MATLAB 1 This document is an excerpt from Resampling Stats in MATLAB Daniel T. Kaplan Copyright (c) 1999 by Daniel T. Kaplan, All Rights Reserved This document differs from the published

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS 1. SYSTEMS OF EQUATIONS AND MATRICES 1.1. Representation of a linear system. The general system of m equations in n unknowns can be written a 11 x 1 + a 12 x 2 +

More information

Analysis of System Performance IN2072 Chapter M Matlab Tutorial

Analysis of System Performance IN2072 Chapter M Matlab Tutorial Chair for Network Architectures and Services Prof. Carle Department of Computer Science TU München Analysis of System Performance IN2072 Chapter M Matlab Tutorial Dr. Alexander Klein Prof. Dr.-Ing. Georg

More information

Introduction to Matrix Algebra

Introduction to Matrix Algebra Psychology 7291: Multivariate Statistics (Carey) 8/27/98 Matrix Algebra - 1 Introduction to Matrix Algebra Definitions: A matrix is a collection of numbers ordered by rows and columns. It is customary

More information

Excel supplement: Chapter 7 Matrix and vector algebra

Excel supplement: Chapter 7 Matrix and vector algebra Excel supplement: Chapter 7 atrix and vector algebra any models in economics lead to large systems of linear equations. These problems are particularly suited for computers. The main purpose of this chapter

More information

MATLAB Functions. function [Out_1,Out_2,,Out_N] = function_name(in_1,in_2,,in_m)

MATLAB Functions. function [Out_1,Out_2,,Out_N] = function_name(in_1,in_2,,in_m) MATLAB Functions What is a MATLAB function? A MATLAB function is a MATLAB program that performs a sequence of operations specified in a text file (called an m-file because it must be saved with a file

More information

Chapter 07: Instruction Level Parallelism VLIW, Vector, Array and Multithreaded Processors. Lesson 05: Array Processors

Chapter 07: Instruction Level Parallelism VLIW, Vector, Array and Multithreaded Processors. Lesson 05: Array Processors Chapter 07: Instruction Level Parallelism VLIW, Vector, Array and Multithreaded Processors Lesson 05: Array Processors Objective To learn how the array processes in multiple pipelines 2 Array Processor

More information

15.062 Data Mining: Algorithms and Applications Matrix Math Review

15.062 Data Mining: Algorithms and Applications Matrix Math Review .6 Data Mining: Algorithms and Applications Matrix Math Review The purpose of this document is to give a brief review of selected linear algebra concepts that will be useful for the course and to develop

More information

Vectors VECTOR PRODUCT. Graham S McDonald. A Tutorial Module for learning about the vector product of two vectors. Table of contents Begin Tutorial

Vectors VECTOR PRODUCT. Graham S McDonald. A Tutorial Module for learning about the vector product of two vectors. Table of contents Begin Tutorial Vectors VECTOR PRODUCT Graham S McDonald A Tutorial Module for learning about the vector product of two vectors Table of contents Begin Tutorial c 2004 g.s.mcdonald@salford.ac.uk 1. Theory 2. Exercises

More information

A Primer on Using PROC IML

A Primer on Using PROC IML Primer on Using PROC IML SS Interactive Matrix Language (IML) is a SS procedure. IML is a matrix language and has built-in operators and functions for most standard matrix operations. To invoke the procedure,

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Section 1: How will you be tested? This section will give you information about the different types of examination papers that are available.

Section 1: How will you be tested? This section will give you information about the different types of examination papers that are available. REVISION CHECKLIST for IGCSE Mathematics 0580 A guide for students How to use this guide This guide describes what topics and skills you need to know for your IGCSE Mathematics examination. It will help

More information

Creating Basic Excel Formulas

Creating Basic Excel Formulas Creating Basic Excel Formulas Formulas are equations that perform calculations on values in your worksheet. Depending on how you build a formula in Excel will determine if the answer to your formula automatically

More information

Using Casio Graphics Calculators

Using Casio Graphics Calculators Using Casio Graphics Calculators (Some of this document is based on papers prepared by Donald Stover in January 2004.) This document summarizes calculation and programming operations with many contemporary

More information

Introduction to Matrices for Engineers

Introduction to Matrices for Engineers Introduction to Matrices for Engineers C.T.J. Dodson, School of Mathematics, Manchester Universit 1 What is a Matrix? A matrix is a rectangular arra of elements, usuall numbers, e.g. 1 0-8 4 0-1 1 0 11

More information

Introductory Course to Matlab with Financial Case Studies

Introductory Course to Matlab with Financial Case Studies University of Cyprus Public Business Administration Department Introductory Course to Matlab with Financial Case Studies Prepared by: Panayiotis Andreou PhD Candidate PBA UCY Lefkosia, September 003 Table

More information

Linear Algebra Review. Vectors

Linear Algebra Review. Vectors Linear Algebra Review By Tim K. Marks UCSD Borrows heavily from: Jana Kosecka kosecka@cs.gmu.edu http://cs.gmu.edu/~kosecka/cs682.html Virginia de Sa Cogsci 8F Linear Algebra review UCSD Vectors The length

More information

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65 Simulation Tools Python for MATLAB Users I Claus Führer Automn 2009 Claus Führer Simulation Tools Automn 2009 1 / 65 1 Preface 2 Python vs Other Languages 3 Examples and Demo 4 Python Basics Basic Operations

More information

I PUC - Computer Science. Practical s Syllabus. Contents

I PUC - Computer Science. Practical s Syllabus. Contents I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations

More information

Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering

Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering Engineering Problem Solving and Excel EGN 1006 Introduction to Engineering Mathematical Solution Procedures Commonly Used in Engineering Analysis Data Analysis Techniques (Statistics) Curve Fitting techniques

More information

28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. v x. u y v z u z v y u y u z. v y v z

28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. v x. u y v z u z v y u y u z. v y v z 28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE 1.4 Cross Product 1.4.1 Definitions The cross product is the second multiplication operation between vectors we will study. The goal behind the definition

More information

Basic Concepts in Matlab

Basic Concepts in Matlab Basic Concepts in Matlab Michael G. Kay Fitts Dept. of Industrial and Systems Engineering North Carolina State University Raleigh, NC 769-7906, USA kay@ncsu.edu September 00 Contents. The Matlab Environment.

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS Systems of Equations and Matrices Representation of a linear system The general system of m equations in n unknowns can be written a x + a 2 x 2 + + a n x n b a

More information

Vector and Matrix Norms

Vector and Matrix Norms Chapter 1 Vector and Matrix Norms 11 Vector Spaces Let F be a field (such as the real numbers, R, or complex numbers, C) with elements called scalars A Vector Space, V, over the field F is a non-empty

More information

How To Use Matlab

How To Use Matlab INTRODUCTION TO MATLAB FOR ENGINEERING STUDENTS David Houcque Northwestern University (version 1.2, August 2005) Contents 1 Tutorial lessons 1 1 1.1 Introduction.................................... 1 1.2

More information

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P. SQL databases An introduction AMP: Apache, mysql, PHP This installations installs the Apache webserver, the PHP scripting language, and the mysql database on your computer: Apache: runs in the background

More information

Linear Algebra: Vectors

Linear Algebra: Vectors A Linear Algebra: Vectors A Appendix A: LINEAR ALGEBRA: VECTORS TABLE OF CONTENTS Page A Motivation A 3 A2 Vectors A 3 A2 Notational Conventions A 4 A22 Visualization A 5 A23 Special Vectors A 5 A3 Vector

More information

Solving Mass Balances using Matrix Algebra

Solving Mass Balances using Matrix Algebra Page: 1 Alex Doll, P.Eng, Alex G Doll Consulting Ltd. http://www.agdconsulting.ca Abstract Matrix Algebra, also known as linear algebra, is well suited to solving material balance problems encountered

More information

CD-ROM Appendix E: Matlab

CD-ROM Appendix E: Matlab CD-ROM Appendix E: Matlab Susan A. Fugett Matlab version 7 or 6.5 is a very powerful tool useful for many kinds of mathematical tasks. For the purposes of this text, however, Matlab 7 or 6.5 will be used

More information

MATH 423 Linear Algebra II Lecture 38: Generalized eigenvectors. Jordan canonical form (continued).

MATH 423 Linear Algebra II Lecture 38: Generalized eigenvectors. Jordan canonical form (continued). MATH 423 Linear Algebra II Lecture 38: Generalized eigenvectors Jordan canonical form (continued) Jordan canonical form A Jordan block is a square matrix of the form λ 1 0 0 0 0 λ 1 0 0 0 0 λ 0 0 J = 0

More information

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2 MATHEMATICS FO ENGINEES BASIC MATIX THEOY TUTOIAL This is the second of two tutorials on matrix theory. On completion you should be able to do the following. Explain the general method for solving simultaneous

More information

PTC Mathcad Prime 3.0 Keyboard Shortcuts

PTC Mathcad Prime 3.0 Keyboard Shortcuts PTC Mathcad Prime 3.0 Shortcuts Swedish s Regions Inserting Regions Operator/Command Description Shortcut Swedish Area Inserts a collapsible area you can collapse or expand to toggle the display of your

More information

How Does My TI-84 Do That

How Does My TI-84 Do That How Does My TI-84 Do That A guide to using the TI-84 for statistics Austin Peay State University Clarksville, Tennessee How Does My TI-84 Do That A guide to using the TI-84 for statistics Table of Contents

More information

Operation Count; Numerical Linear Algebra

Operation Count; Numerical Linear Algebra 10 Operation Count; Numerical Linear Algebra 10.1 Introduction Many computations are limited simply by the sheer number of required additions, multiplications, or function evaluations. If floating-point

More information

Beginning Matlab Exercises

Beginning Matlab Exercises Beginning Matlab Exercises R. J. Braun Department of Mathematical Sciences University of Delaware 1 Introduction This collection of exercises is inted to help you start learning Matlab. Matlab is a huge

More information

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have 8.6 Rational Exponents 8.6 OBJECTIVES 1. Define rational exponents 2. Simplify expressions containing rational exponents 3. Use a calculator to estimate the value of an expression containing rational exponents

More information

arrays C Programming Language - Arrays

arrays C Programming Language - Arrays arrays So far, we have been using only scalar variables scalar meaning a variable with a single value But many things require a set of related values coordinates or vectors require 3 (or 2, or 4, or more)

More information

Matrix Differentiation

Matrix Differentiation 1 Introduction Matrix Differentiation ( and some other stuff ) Randal J. Barnes Department of Civil Engineering, University of Minnesota Minneapolis, Minnesota, USA Throughout this presentation I have

More information

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89 by Joseph Collison Copyright 2000 by Joseph Collison All rights reserved Reproduction or translation of any part of this work beyond that permitted by Sections

More information

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes The Scalar Product 9.4 Introduction There are two kinds of multiplication involving vectors. The first is known as the scalar product or dot product. This is so-called because when the scalar product of

More information

Microsoft Excel 2010 Part 3: Advanced Excel

Microsoft Excel 2010 Part 3: Advanced Excel CALIFORNIA STATE UNIVERSITY, LOS ANGELES INFORMATION TECHNOLOGY SERVICES Microsoft Excel 2010 Part 3: Advanced Excel Winter 2015, Version 1.0 Table of Contents Introduction...2 Sorting Data...2 Sorting

More information

Lecture 2 Matrix Operations

Lecture 2 Matrix Operations Lecture 2 Matrix Operations transpose, sum & difference, scalar multiplication matrix multiplication, matrix-vector product matrix inverse 2 1 Matrix transpose transpose of m n matrix A, denoted A T or

More information

Useful Mathematical Symbols

Useful Mathematical Symbols 32 Useful Mathematical Symbols Symbol What it is How it is read How it is used Sample expression + * ddition sign OR Multiplication sign ND plus or times and x Multiplication sign times Sum of a few disjunction

More information

13 MATH FACTS 101. 2 a = 1. 7. The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

13 MATH FACTS 101. 2 a = 1. 7. The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions. 3 MATH FACTS 0 3 MATH FACTS 3. Vectors 3.. Definition We use the overhead arrow to denote a column vector, i.e., a linear segment with a direction. For example, in three-space, we write a vector in terms

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix.

MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix. MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix. Nullspace Let A = (a ij ) be an m n matrix. Definition. The nullspace of the matrix A, denoted N(A), is the set of all n-dimensional column

More information

Matrix Indexing in MATLAB

Matrix Indexing in MATLAB 1 of 6 10/8/01 11:47 AM Matrix Indexing in MATLAB by Steve Eddins and Loren Shure Send email to Steve Eddins and Loren Shure Indexing into a matrix is a means of selecting a subset of elements from the

More information

Math 1050 Khan Academy Extra Credit Algebra Assignment

Math 1050 Khan Academy Extra Credit Algebra Assignment Math 1050 Khan Academy Extra Credit Algebra Assignment KhanAcademy.org offers over 2,700 instructional videos, including hundreds of videos teaching algebra concepts, and corresponding problem sets. In

More information

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Lecture L3 - Vectors, Matrices and Coordinate Transformations S. Widnall 16.07 Dynamics Fall 2009 Lecture notes based on J. Peraire Version 2.0 Lecture L3 - Vectors, Matrices and Coordinate Transformations By using vectors and defining appropriate operations between

More information

3.2 Matrix Multiplication

3.2 Matrix Multiplication 3.2 Matrix Multiplication Question : How do you multiply two matrices? Question 2: How do you interpret the entries in a product of two matrices? When you add or subtract two matrices, you add or subtract

More information

WEEK #3, Lecture 1: Sparse Systems, MATLAB Graphics

WEEK #3, Lecture 1: Sparse Systems, MATLAB Graphics WEEK #3, Lecture 1: Sparse Systems, MATLAB Graphics Visualization of Matrices Good visuals anchor any presentation. MATLAB has a wide variety of ways to display data and calculation results that can be

More information

LESSON QUESTIONS: Bar charts

LESSON QUESTIONS: Bar charts LESSON QUESTIONS: Bar charts FOCUS QUESTION: How can I show proportions and relative sizes of different data groups? Contents EXAMPLE 1: Load the data about New York contagious diseases EXAMPLE 2: Calculate

More information

Lecture Notes 2: Matrices as Systems of Linear Equations

Lecture Notes 2: Matrices as Systems of Linear Equations 2: Matrices as Systems of Linear Equations 33A Linear Algebra, Puck Rombach Last updated: April 13, 2016 Systems of Linear Equations Systems of linear equations can represent many things You have probably

More information

STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. Clarificationof zonationprocedure described onpp. 238-239

STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. Clarificationof zonationprocedure described onpp. 238-239 STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. by John C. Davis Clarificationof zonationprocedure described onpp. 38-39 Because the notation used in this section (Eqs. 4.8 through 4.84) is inconsistent

More information

v w is orthogonal to both v and w. the three vectors v, w and v w form a right-handed set of vectors.

v w is orthogonal to both v and w. the three vectors v, w and v w form a right-handed set of vectors. 3. Cross product Definition 3.1. Let v and w be two vectors in R 3. The cross product of v and w, denoted v w, is the vector defined as follows: the length of v w is the area of the parallelogram with

More information

7.4. The Inverse of a Matrix. Introduction. Prerequisites. Learning Style. Learning Outcomes

7.4. The Inverse of a Matrix. Introduction. Prerequisites. Learning Style. Learning Outcomes The Inverse of a Matrix 7.4 Introduction In number arithmetic every number a 0 has a reciprocal b written as a or such that a ba = ab =. Similarly a square matrix A may have an inverse B = A where AB =

More information

Almost all spreadsheet programs are based on a simple concept: the malleable matrix.

Almost all spreadsheet programs are based on a simple concept: the malleable matrix. MS EXCEL 2000 Spreadsheet Use, Formulas, Functions, References More than any other type of personal computer software, the spreadsheet has changed the way people do business. Spreadsheet software allows

More information

Review Jeopardy. Blue vs. Orange. Review Jeopardy

Review Jeopardy. Blue vs. Orange. Review Jeopardy Review Jeopardy Blue vs. Orange Review Jeopardy Jeopardy Round Lectures 0-3 Jeopardy Round $200 How could I measure how far apart (i.e. how different) two observations, y 1 and y 2, are from each other?

More information

How To Use Excel With A Calculator

How To Use Excel With A Calculator Functions & Data Analysis Tools Academic Computing Services www.ku.edu/acs Abstract: This workshop focuses on the functions and data analysis tools of Microsoft Excel. Topics included are the function

More information

Specifying Data. 9.1 Formatted data: the data command

Specifying Data. 9.1 Formatted data: the data command 9 Specifying Data As we emphasize throughout this book, there is a distinction between an AMPL model for an optimization problem, and the data values that define a particular instance of the problem. Chapters

More information

MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt

MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt Lesson Notes Author: Pamela Schmidt Tables Text Fields (Default) Text or combinations of text and numbers, as well as numbers that don't require calculations, such as phone numbers. or the length set by

More information

Algebra 1: Basic Skills Packet Page 1 Name: Integers 1. 54 + 35 2. 18 ( 30) 3. 15 ( 4) 4. 623 432 5. 8 23 6. 882 14

Algebra 1: Basic Skills Packet Page 1 Name: Integers 1. 54 + 35 2. 18 ( 30) 3. 15 ( 4) 4. 623 432 5. 8 23 6. 882 14 Algebra 1: Basic Skills Packet Page 1 Name: Number Sense: Add, Subtract, Multiply or Divide without a Calculator Integers 1. 54 + 35 2. 18 ( 30) 3. 15 ( 4) 4. 623 432 5. 8 23 6. 882 14 Decimals 7. 43.21

More information

SOME EXCEL FORMULAS AND FUNCTIONS

SOME EXCEL FORMULAS AND FUNCTIONS SOME EXCEL FORMULAS AND FUNCTIONS About calculation operators Operators specify the type of calculation that you want to perform on the elements of a formula. Microsoft Excel includes four different types

More information

Orthogonal Diagonalization of Symmetric Matrices

Orthogonal Diagonalization of Symmetric Matrices MATH10212 Linear Algebra Brief lecture notes 57 Gram Schmidt Process enables us to find an orthogonal basis of a subspace. Let u 1,..., u k be a basis of a subspace V of R n. We begin the process of finding

More information

A few useful MATLAB functions

A few useful MATLAB functions A few useful MATLAB functions Renato Feres - Math 350 Fall 2012 1 Uniform random numbers The Matlab command rand is based on a popular deterministic algorithm called multiplicative congruential method.

More information

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0 VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...

More information

Signal Processing First Lab 01: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization.

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

More information

18.06 Problem Set 4 Solution Due Wednesday, 11 March 2009 at 4 pm in 2-106. Total: 175 points.

18.06 Problem Set 4 Solution Due Wednesday, 11 March 2009 at 4 pm in 2-106. Total: 175 points. 806 Problem Set 4 Solution Due Wednesday, March 2009 at 4 pm in 2-06 Total: 75 points Problem : A is an m n matrix of rank r Suppose there are right-hand-sides b for which A x = b has no solution (a) What

More information

DRAFT. Further mathematics. GCE AS and A level subject content

DRAFT. Further mathematics. GCE AS and A level subject content Further mathematics GCE AS and A level subject content July 2014 s Introduction Purpose Aims and objectives Subject content Structure Background knowledge Overarching themes Use of technology Detailed

More information

The Center for Teaching, Learning, & Technology

The Center for Teaching, Learning, & Technology The Center for Teaching, Learning, & Technology Instructional Technology Workshops Microsoft Excel 2010 Formulas and Charts Albert Robinson / Delwar Sayeed Faculty and Staff Development Programs Colston

More information

Chapter One Introduction to Programming

Chapter One Introduction to Programming Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of

More information

Syntax Description Remarks and examples Also see

Syntax Description Remarks and examples Also see Title stata.com permutation An aside on permutation matrices and vectors Syntax Description Remarks and examples Also see Syntax Permutation matrix Permutation vector Action notation notation permute rows

More information

Examples of Functions

Examples of Functions Examples of Functions In this document is provided examples of a variety of functions. The purpose is to convince the beginning student that functions are something quite different than polynomial equations.

More information

Commonly Used Excel Functions. Supplement to Excel for Budget Analysts

Commonly Used Excel Functions. Supplement to Excel for Budget Analysts Supplement to Excel for Budget Analysts Version 1.0: February 2016 Table of Contents Introduction... 4 Formulas and Functions... 4 Math and Trigonometry Functions... 5 ABS... 5 ROUND, ROUNDUP, and ROUNDDOWN...

More information

EXCEL SOLVER TUTORIAL

EXCEL SOLVER TUTORIAL ENGR62/MS&E111 Autumn 2003 2004 Prof. Ben Van Roy October 1, 2003 EXCEL SOLVER TUTORIAL This tutorial will introduce you to some essential features of Excel and its plug-in, Solver, that we will be using

More information

A.2. Exponents and Radicals. Integer Exponents. What you should learn. Exponential Notation. Why you should learn it. Properties of Exponents

A.2. Exponents and Radicals. Integer Exponents. What you should learn. Exponential Notation. Why you should learn it. Properties of Exponents Appendix A. Exponents and Radicals A11 A. Exponents and Radicals What you should learn Use properties of exponents. Use scientific notation to represent real numbers. Use properties of radicals. Simplify

More information

Introduction to Modern Data Acquisition with LabVIEW and MATLAB. By Matt Hollingsworth

Introduction to Modern Data Acquisition with LabVIEW and MATLAB. By Matt Hollingsworth Introduction to Modern Data Acquisition with LabVIEW and MATLAB By Matt Hollingsworth Introduction to Modern Data Acquisition Overview... 1 LabVIEW Section 1.1: Introduction to LabVIEW... 3 Section 1.2:

More information

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions.

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions. Algebra I Overview View unit yearlong overview here Many of the concepts presented in Algebra I are progressions of concepts that were introduced in grades 6 through 8. The content presented in this course

More information

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20 SECTION.4 Multiplying and Dividing Signed Numbers.4 OBJECTIVES 1. Multiply signed numbers 2. Use the commutative property of multiplication 3. Use the associative property of multiplication 4. Divide signed

More information