EN 001-4: Introduction to Computational Design. Matrices & vectors. Why do we care about vectors? What is a matrix and a vector?

Size: px
Start display at page:

Download "EN 001-4: Introduction to Computational Design. Matrices & vectors. Why do we care about vectors? What is a matrix and a vector?"

Transcription

1 EN 001-: Introduction to Computational Design Fall 2017 Tufts University Instructor: Soha Hassoun Matrices & vectors Matlab is short for MATrix LABoratory. In Matlab, pretty much everything is actually a matrix. So one would expect Matlab to work well with matrices. By and large, that s true. But first, of course what is a matrix & why do we care? 1 2 What is a matrix and a vector? A vector is an ordered, indexed group of variables that share the same name. It's like a variable, but with a bunch of buckets in a row that are all numbered. Other languages call it an array. Example: vec1 = [1 3 7]; We use brackets to declare a vector but parentheses to access it! Then vec1(1) is 1; vec1(2) is 3; vec1(3) is 7. This is a row vector (your high-school math teacher may have also taught you about column vectors). Terminology: the individual elements of the vector are called, well, elements. Our vec1 has 3 elements. 3 Why do we care about vectors? A vector lets you collect a bunch of similar things, refer to them by one name, and operate on all of them at once. Consider the grades of a -student class for HW1: HW1_a=90; HW1 = [90,99,0,90]; HW1_b=99; HW1_c=0; HW1_d=90; Which format would you rather work with? What if there were 100 students rather than? But wait, there s more Consider the same deal for HW2: HW2 = [91,80,55,93]; HW2_a=91; HW2_b=80; HW2_c=55; HW2_d=93; What if you want the average? avg=(hw1+hw2)/2; Works no matter how many students there are! Yes it does! Avg_a=(HW1_a+HW2_a)/2; Avg_b=(HW1_b+HW2_b)/2; Avg_c=(HW1_c+HW2_c)/2; Avg_d=(HW1_d+HW2_d)/2; 5 Vector-scalar operations vec1=[ ]; vec1 = vec1 * 1.1; Perhaps we re storing how much money everyone has, and they all got 10% interest. What do you think this would do? vec2 = vec ; 1

2 Vector-vector operations vec1=[ ]; vec2=[ ]; What do you think these would do? vec3 = vec1 + vec2; vec3 = vec1 * vec2; vec3 = vec1.* vec2; It s illegal to multiply two row vectors. We ll see why shortly The.* operator does element-by-element multiplication on two vectors Where else might vectors be useful? Any other ideas where vectors might be useful? Height of 100 patients (or weight) Temperature of each day of the year Really, most any time you want to keep track of a big bunch of items 7 8 More tricks with vectors vec1 = 2:; % same as [2 3 5 ] vec1 = 2:3:12; % same as [ ] Hmmm this is the same notation as for i=2: for i=2:3:12 What do you think this code would do? vec1=2:; for i=vec1 stuff end exactly the same as for i=2: stuff end Under the hood, a for loop merely iterates through the elements of a vector! Just a reminder Let's write this down I've gotten it wrong about a hundred times already myself: You usually create matrices using brackets: mat=[1 2 3] You access matrices using parenthesis: mat(1) If you get it backwards, you'll get an error message that may not be incredibly clear Still more tricks with vectors vec1 = 2:3:12; vec1(1); vec1(3); vec1(2:3); numel(vec1); vec1(2)= ; vec1(2)=[]; vec1 = [1,2 3]; Concatenating vectors vec1=[ ]; vec2=[ ]; vec3 = [vec1 vec2]; vec3 = [ vec2]; vec3 = [vec ];

3 Strings are really vectors! A string is just a row vector str = 'abcd' str = ['ab' 'cd'] str=['a' 'b' 'c' 'd'] str=['ab' 'cd'] str=strcat('ab','cd') Deleting pieces There is an empty vector: []. vec1=[ ]; vec1(3)=[]; vec1(2:3)=[]; Of course, the same works with strings name='wilbur'; name(:)=[]; name(3)='nnie'; 13 1 A bit of confusion disp(i) disp(i*i) That's because 'i' is the square root of -1 in math. i=3; disp(i) sqrt(-1) The motto: Matlab has a default meaning for 'i', but you can overrule it if you want. It works the same for vectors sqrt() sqrt = [2 8 10]; sqrt() Just like before, there is a default meaning for sqrt, but you can overrule it! The thing that "sqrt" refers to can change over time. another example: you can set var=1 and later set var='abc'; the same variable can change from number to string On to matrices A vector is just 1 dimension We showed a row vector; we ll also do column vectors. A matrix is 2 dimensions (a rectangular array) mat1 = [1 2 3; 5 ] yields Each ; starts a new row Why might we want matrices? What are some uses for matrices?

4 A matrix as a bunch of rows Column vectors We could do: HW1 = [90,99,0,90]; HW2 = [91,80,55,93]; Or just do HW= [90,99,0,90; 91,80,55,93] colvec = [1; 3; 7] 3x1 column vector It s just a matrix with 3 rows and one column Tricks with matrices Repmat HW= [90,99,0,90; 91,80,55,93]; size(hw) % numel(hw) % HW(2,3) % HW(:,2) HW(1,2:3) HW([1 2],[2 ]) Repmat() repeats a matrix. Assign my_mat=[1 5 3;2 1 ] repmat(my_mat, 2,1) repmat(my_mat, 1,2) repmat(my_mat,3,2) It all starts to make sense Appending matrices, take 2 Remember when we did repmat ('*',1,3) to make '***'? '*' is a 1x1 matrix with (1)='*'. repmat('*',1,3) repeats that matrix 3 times gives us a matrix with (1)='*', (2)='*', (3)='*'. And this is just the string '***'. Similarly, repmat ('ab',1,2) 'abab' mat1=[1 2;3 ] mat2=[5 ; 7 8] [mat1 mat2] [mat1; mat2]

5 Not everything can be appended a=[1 2 3]; [1 2 3] b=[; 5; ]; [a b] 5 Matrix multiplication Review from high school (hopefully J) i th row, j th column = i th row j th column * 2 = 28 (1*2 + 2* + 3*) * = (e,g., 2 nd row 1 st column = (3 )*(5 7) = 3*5 + *7 = More matrix multiplication Column vectors and transposes Not all arrays can be multiplied (the matrices must be conformal): [1 2 3] * [ 5 ] * 5 = illegal * 5 = illegal Why? Any row of [1 2 3] has 3 elements, but any column of [ 5 ] has only 1 element, so you cannot take their dot product. E.g., 1 st row, 1 st column would be (1 st row of [1 2 3])*(1 st column of [ 5 ]) = 1* + 2*? + 3*?. It doesn't work. 27 [1 2 3] * [; 5; ] [1 2 3] * [ 5 ]' * 2 = Transposes in general.* means element by element You transpose any matrix by switching rows & columns. So for any matrix my_mat, we have my_mat(r,c) = my_mat'(c,r) my_mat=[1 5 3;2 ] my_mat' [1 2 3] * [ 5 ] [1 2 3].* [ 5 ] * 5 = illegal * 5 = * =

6 System of equations: 2x + 3y = 1 1x + 2y = 8 Matlab version a=[2 3; 1 2]; b = [1; 8]; Linear equations a \ b % solves the equations and returns [; 2] Chooses between several different solvers, depending on the matrices you give it. x y = 1 8 Yeah, matrices might even be useful J Linear indexing Matlab's linear indexing lets you access a matrix with just one index Normal: HW= [90,99,0,90; 91,80,55,93]; HW(2,3) is 55 Linear indexing: HW(2) is 91, and HW(3) is 99 and HW(8) is 93, and HW([2 5]) is [91 0]. But why did they do this? Any thoughts? The find() function vec=find (HW>90) % Returns a vector of indices of those elements that meet the condition HW(vec) % So we have an easy way to find elements of a matrix that meet a condition. Or, even easier, HW(find(HW>90)) yields [ ]. sum() The sum() function sums up each column and returns a row vector. sum(hw) [ ] It will also sum a column vector into a single number (as expected) It will also sum a row vector into a single number! Stuff to explore yourself A few more functions you can explore yourself : prod(): like sum(), but multiplies max(): like sum(), but takes the max inv(): matrix inversion ones(), zeros(), eye(): build some simple matrices Group activity; what does this code do? HW = HW+1 HW(find(HW<5)) = 70 HW(find(HW<5) = HW(find(HW<5)) + 5 HW(:, find(sum(hw)/2 <85)) = [] 35 3

7 Matrices and dog barf Uninitialized variables caused an error >> clear >> a Undefined function or variable 'a'. Does the same apply to matrices? >> clear >> b(2,3) Undefined function or variable 'b'. So, yes it does; but there's more to it than that. Initializing matrices a = [3,,9]; Creates a 1x3 vector and initializes it all at once. b = zeros(3,5); Creates a 3x5 matrix of zeros c(10)=1; what does this do? no possibility of eating dog barf Social networks Let s talk about social networks. What are the big social-network sites? Do they have a concept of a friend? Is friend always symmetric? Are there different levels of friendship? How might we store the network? Our network will be simple Friendship is always symmetric You're either friends or not. That's all. Some thoughts on how to organize the data: A row vector. Each element is a string such as AmyN,BillJ (meaning that Amy and Bill are friends) A matrix. People get numbered. The friendship level between person #i and #j is stored at mat(i,j). Other ideas? 39 0 Group activity How might you find how many friends Dan has? How might you find out how many people have no friends at all? (hint: you don't need any loops) Ann Bill Cat Dan Ann Bill Cat Dan

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors.

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors. 1 LECTURE 3 OUTLINES Variable names in MATLAB Examples Matrices, Vectors and Scalar Scalar Vectors Entering a vector Colon operator ( : ) Mathematical operations on vectors examples 2 VARIABLE NAMES IN

More information

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

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

More information

Matrices. A Matrix (This one has 2 Rows and 3 Columns) To add two matrices: add the numbers in the matching positions:

Matrices. A Matrix (This one has 2 Rows and 3 Columns) To add two matrices: add the numbers in the matching positions: Matrices A Matrix is an array of numbers: We talk about one matrix, or several matrices. There are many things we can do with them... Adding A Matrix (This one has 2 Rows and 3 Columns) To add two matrices:

More information

Square Roots: Introduction & Simplification

Square Roots: Introduction & Simplification Square Roots: Introduction & Simplification You already know about squaring. For instance, 2 2 = 4, 3 2 = 9, etc. The backwards of squaring is square-rooting. The symbol for square-rooting is " ", the

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

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

More information

LAB 2 VECTORS AND MATRICES

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

More information

Chapter 1: Number and Operations

Chapter 1: Number and Operations Chapter 1: Number and Operations 1.1 Order of operations When simplifying algebraic expressions we use the following order: 1. Perform operations within a parenthesis. 2. Evaluate exponents. 3. Multiply

More information

MITOCW ocw f99-lec07_300k

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

More information

FreeMat Tutorial. 3x + 4y 2z = 5 2x 5y + z = 8 x x + 3y = -1 xx

FreeMat Tutorial. 3x + 4y 2z = 5 2x 5y + z = 8 x x + 3y = -1 xx 1 of 9 FreeMat Tutorial FreeMat is a general purpose matrix calculator. It allows you to enter matrices and then perform operations on them in the same way you would write the operations on paper. This

More information

Basic matrix math in R

Basic matrix math in R 1 Basic matrix math in R This chapter reviews the basic matrix math operations that you will need to understand the course material and how to do these operations in R. 1.1 Creating matrices in R Create

More information

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

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

More information

PetShop (BYU Students, SIGGRAPH 2006)

PetShop (BYU Students, SIGGRAPH 2006) Now Playing: PetShop (BYU Students, SIGGRAPH 2006) My Mathematical Mind Spoon From Gimme Fiction Released May 10, 2005 Geometric Objects in Computer Graphics Rick Skarbez, Instructor COMP 575 August 30,

More information

MITOCW ocw f99-lec12_300k

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

More information

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

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

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

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

More information

MATLAB Tutorial Matrices & Vectors MATRICES AND VECTORS

MATLAB Tutorial Matrices & Vectors MATRICES AND VECTORS MATRICES AND VECTORS A matrix (m x n) with m rows and n columns, a column vector (m x 1) with m rows and 1 column, and a row vector (1 x m) with 1 row and m columns all can be used in MATLAB. Matrices

More information

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab MATH 495.3 (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab Below is a screen similar to what you should see when you open Matlab. The command window is the large box to the right containing the

More information

MAT 003 Brian Killough s Instructor Notes Saint Leo University

MAT 003 Brian Killough s Instructor Notes Saint Leo University MAT 003 Brian Killough s Instructor Notes Saint Leo University Success in online courses requires self-motivation and discipline. It is anticipated that students will read the textbook and complete sample

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

Math 1505G, 2013 Graphs and Matrices

Math 1505G, 2013 Graphs and Matrices Math 505G, 0 Graphs and Matrices September 7, 0 These are some notes for the short talk I gave the other day. We ll discuss an interesting application of matrix algebra. This is outside what will be tested

More information

Lab 4 CSE 7, Spring 2018 This lab is an introduction to using logical and comparison operators in Matlab.

Lab 4 CSE 7, Spring 2018 This lab is an introduction to using logical and comparison operators in Matlab. LEARNING OBJECTIVES: Lab 4 CSE 7, Spring 2018 This lab is an introduction to using logical and comparison operators in Matlab 1 Use comparison operators (< > = == ~=) between two scalar values to create

More information

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. Guide to and Hi everybody! In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. This guide focuses on two of those symbols: and. These symbols represent concepts

More information

The inverse of a matrix

The inverse of a matrix The inverse of a matrix A matrix that has an inverse is called invertible. A matrix that does not have an inverse is called singular. Most matrices don't have an inverse. The only kind of matrix that has

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

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

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

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

More information

Matrix Inverse 2 ( 2) 1 = 2 1 2

Matrix Inverse 2 ( 2) 1 = 2 1 2 Name: Matrix Inverse For Scalars, we have what is called a multiplicative identity. This means that if we have a scalar number, call it r, then r multiplied by the multiplicative identity equals r. Without

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

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

More information

Note: Please use the actual date you accessed this material in your citation.

Note: Please use the actual date you accessed this material in your citation. MIT OpenCourseWare http://ocw.mit.edu 18.06 Linear Algebra, Spring 2005 Please use the following citation format: Gilbert Strang, 18.06 Linear Algebra, Spring 2005. (Massachusetts Institute of Technology:

More information

Algebra 2 Common Core Summer Skills Packet

Algebra 2 Common Core Summer Skills Packet Algebra 2 Common Core Summer Skills Packet Our Purpose: Completion of this packet over the summer before beginning Algebra 2 will be of great value to helping students successfully meet the academic challenges

More information

Table of Laplace Transforms

Table of Laplace Transforms Table of Laplace Transforms 1 1 2 3 4, p > -1 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Heaviside Function 27 28. Dirac Delta Function 29 30. 31 32. 1 33 34. 35 36. 37 Laplace Transforms

More information

Vector: A series of scalars contained in a column or row. Dimensions: How many rows and columns a vector or matrix has.

Vector: A series of scalars contained in a column or row. Dimensions: How many rows and columns a vector or matrix has. ASSIGNMENT 0 Introduction to Linear Algebra (Basics of vectors and matrices) Due 3:30 PM, Tuesday, October 10 th. Assignments should be submitted via e-mail to: matlabfun.ucsd@gmail.com You can also submit

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG 1 Notice Assignments Reading Assignment: Chapter 3: Introduction to Parameters and Objects The Class 10 Exercise

More information

A lot of people make repeated mistakes of not calling their functions and getting errors. Make sure you're calling your functions.

A lot of people make repeated mistakes of not calling their functions and getting errors. Make sure you're calling your functions. Handout 2 Functions, Lists, For Loops and Tuples [ ] Functions -- parameters/arguments, "calling" functions, return values, etc. Please make sure you understand this example: def square(x): return x *

More information

Performing Matrix Operations on the TI-83/84

Performing Matrix Operations on the TI-83/84 Page1 Performing Matrix Operations on the TI-83/84 While the layout of most TI-83/84 models are basically the same, of the things that can be different, one of those is the location of the Matrix key.

More information

Introduction to Matlab

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

More information

x = 12 x = 12 1x = 16

x = 12 x = 12 1x = 16 2.2 - The Inverse of a Matrix We've seen how to add matrices, multiply them by scalars, subtract them, and multiply one matrix by another. The question naturally arises: Can we divide one matrix by another?

More information

Array Creation ENGR 1181 MATLAB 2

Array Creation ENGR 1181 MATLAB 2 Array Creation ENGR 1181 MATLAB 2 Array Creation In The Real World Civil engineers store seismic data in arrays to analyze plate tectonics as well as fault patterns. These sets of data are critical to

More information

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

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

More information

MITOCW watch?v=9h6muyzjms0

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

More information

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors.

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors. Physics 326G Winter 2008 Class 2 In this class you will learn how to define and work with arrays or vectors. Matlab is designed to work with arrays. An array is a list of numbers (or other things) arranged

More information

Intro. Speed V Growth

Intro. Speed V Growth Intro Good code is two things. It's elegant, and it's fast. In other words, we got a need for speed. We want to find out what's fast, what's slow, and what we can optimize. First, we'll take a tour of

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Introduction MATLAB is an interactive package for numerical analysis, matrix computation, control system design, and linear system analysis and design available on most CAEN platforms

More information

Skill 1: Multiplying Polynomials

Skill 1: Multiplying Polynomials CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need

More information

MITOCW watch?v=zlohv4xq_ti

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

More information

Section 1.1 Definitions and Properties

Section 1.1 Definitions and Properties Section 1.1 Definitions and Properties Objectives In this section, you will learn to: To successfully complete this section, you need to understand: Abbreviate repeated addition using Exponents and Square

More information

Teaching Manual Math 2131

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

More information

Computing With R Handout 1

Computing With R Handout 1 Computing With R Handout 1 Getting Into R To access the R language (free software), go to a computing lab that has R installed, or a computer on which you have downloaded R from one of the distribution

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

Answers. Chapter 2. 1) Give the coordinates of the following points:

Answers. Chapter 2. 1) Give the coordinates of the following points: Answers Chapter 2 1) Give the coordinates of the following points: a (-2.5, 3) b (1, 2) c (2.5, 2) d (-1, 1) e (0, 0) f (2, -0.5) g (-0.5, -1.5) h (0, -2) j (-3, -2) 1 2) List the 48 different possible

More information

IDM 232. Scripting for Interactive Digital Media II. IDM 232: Scripting for IDM II 1

IDM 232. Scripting for Interactive Digital Media II. IDM 232: Scripting for IDM II 1 IDM 232 Scripting for Interactive Digital Media II IDM 232: Scripting for IDM II 1 PHP HTML-embedded scripting language IDM 232: Scripting for IDM II 2 Before we dive into code, it's important to understand

More information

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

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

More information

Computer Project #2 (Matrix Operations)

Computer Project #2 (Matrix Operations) Math 0280 Introduction to Matrices and Linear Algebra Fall 2006 Computer Project #2 (Matrix Operations) SCHEDULE: This assignment is due in class on Monday, October 23, 2006. One submission per group is

More information

Lesson #17 Function Introduction

Lesson #17 Function Introduction Lesson #17 Function Introduction A.A.37 A.A.40 A.A.41 Define a relation and function Write functions in functional notation Use functional notation to evaluate functions for given values in the domain

More information

How to Improve Your Campaign Conversion Rates

How to Improve Your  Campaign Conversion Rates How to Improve Your Email Campaign Conversion Rates Chris Williams Author of 7 Figure Business Models How to Exponentially Increase Conversion Rates I'm going to teach you my system for optimizing an email

More information

Georgia Department of Education. Fifth Grade UNIT 1 STANDARDS

Georgia Department of Education. Fifth Grade UNIT 1 STANDARDS Dear Parents, Fifth Grade UNIT 1 STANDARDS We want to make sure that you have an understanding of the mathematics your child will be learning this year. Below you will find the standards we will be learning

More information

To add or subtract, just add or subtract the numbers in the same column and row and place answer accordingly.

To add or subtract, just add or subtract the numbers in the same column and row and place answer accordingly. Math 3 Variable Manipulation Part 2 Systems with Matrices MATRICES An alternative method to solving system of equations is using Matrices. However, before we can solve systems of equations using matrices,

More information

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet. Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that

More information

APPM 2460 Matlab Basics

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

More information

SUMMER REVIEW PACKET 2 FOR STUDENTS ENTERING ALGEBRA 1

SUMMER REVIEW PACKET 2 FOR STUDENTS ENTERING ALGEBRA 1 SUMMER REVIEW PACKET FOR STUDENTS ENTERING ALGEBRA Dear Students, Welcome to Ma ayanot. We are very happy that you will be with us in the Fall. The Math department is looking forward to working with you

More information

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

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

More information

Solution Guide for Chapter 12

Solution Guide for Chapter 12 Solution Guide for Chapter 1 Here are the solutions for the Doing the Math exercises in Kiss My Math! DTM from p. 170-1. Start with x. Add, then multiply by 4. So, starting with x, when we add, we ll get:

More information

Course Layout. Go to https://www.license.boun.edu.tr, follow instr. Accessible within campus (only for the first download)

Course Layout. Go to https://www.license.boun.edu.tr, follow instr. Accessible within campus (only for the first download) Course Layout Lectures 1: Variables, Scripts and Operations 2: Visualization and Programming 3: Solving Equations, Fitting 4: Images, Animations, Advanced Methods 5: Optional: Symbolic Math, Simulink Course

More information

GENERAL MATH FOR PASSING

GENERAL MATH FOR PASSING GENERAL MATH FOR PASSING Your math and problem solving skills will be a key element in achieving a passing score on your exam. It will be necessary to brush up on your math and problem solving skills.

More information

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu 0. What is MATLAB? 1 MATLAB stands for matrix laboratory and is one of the most popular software for numerical computation. MATLAB s basic

More information

Course Number 432/433 Title Algebra II (A & B) H Grade # of Days 120

Course Number 432/433 Title Algebra II (A & B) H Grade # of Days 120 Whitman-Hanson Regional High School provides all students with a high- quality education in order to develop reflective, concerned citizens and contributing members of the global community. Course Number

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB --------------------------------------------------------------------------------- Getting MATLAB to Run Programming The Command Prompt Simple Expressions Variables Referencing Matrix

More information

MITOCW watch?v=kz7jjltq9r4

MITOCW watch?v=kz7jjltq9r4 MITOCW watch?v=kz7jjltq9r4 PROFESSOR: We're going to look at the most fundamental of all mathematical data types, namely sets, and let's begin with the definitions. So informally, a set is a collection

More information

MITOCW watch?v=r6-lqbquci0

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

More information

Troubleshooting Maple Worksheets: Common Problems

Troubleshooting Maple Worksheets: Common Problems Troubleshooting Maple Worksheets: Common Problems So you've seen plenty of worksheets that work just fine, but that doesn't always help you much when your worksheet isn't doing what you want it to. This

More information

ANSI C. Data Analysis in Geophysics Demián D. Gómez November 2013

ANSI C. Data Analysis in Geophysics Demián D. Gómez November 2013 ANSI C Data Analysis in Geophysics Demián D. Gómez November 2013 ANSI C Standards published by the American National Standards Institute (1983-1989). Initially developed by Dennis Ritchie between 1969

More information

QUICK EXCEL TUTORIAL. The Very Basics

QUICK EXCEL TUTORIAL. The Very Basics QUICK EXCEL TUTORIAL The Very Basics You Are Here. Titles & Column Headers Merging Cells Text Alignment When we work on spread sheets we often need to have a title and/or header clearly visible. Merge

More information

CME 192: Introduction to Matlab

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

More information

ARRAY VARIABLES (ROW VECTORS)

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

More information

Getting To Know Matlab

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

More information

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

More information

1 of 10 5/11/2006 12:10 AM CS 61A Spring 2006 Midterm 3 solutions 1. Box and pointer. > (let ((x (list 1 2 3))) (set-car! (cdr x) (cddr x)) x) (1 (3) 3) +-------------+ V --------- -- ------ ---------

More information

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

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they

More information

Only to be used for arranged hours. Order of Operations

Only to be used for arranged hours. Order of Operations Math 84 Activity # 1 Your name: Order of Operations Goals: 1) Evaluate Real numbers with Exponents. ) Use the Order of Operations to Evaluate Expressions. ) Review Exponents and Powers of Ten Integer exponents

More information

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type.

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Data Structures Introduction An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Representation of a large number of homogeneous

More information

MITOCW watch?v=flgjisf3l78

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

More information

2: Functions, Equations, and Graphs

2: Functions, Equations, and Graphs 2: Functions, Equations, and Graphs 2-1: Relations and Functions Relations A relation is a set of coordinate pairs some matching between two variables (say, x and y). One of the variables must be labeled

More information

MITOCW watch?v=se4p7ivcune

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

More information

Introduction to MATLAB

Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 Software Philosophy Matrix-based numeric computation MATrix LABoratory built-in support for standard matrix and vector operations High-level programming language Programming

More information

Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology. Scotland T 3. Matrices. Teachers Teaching with Technology (Scotland)

Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology. Scotland T 3. Matrices. Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology T 3 Scotland Matrices Teachers Teaching with Technology (Scotland) MATRICES Aim To demonstrate how the TI-83 can be used to

More information

Watkins Mill High School. Algebra 2. Math Challenge

Watkins Mill High School. Algebra 2. Math Challenge Watkins Mill High School Algebra 2 Math Challenge "This packet will help you prepare for Algebra 2 next fall. It will be collected the first week of school. It will count as a grade in the first marking

More information

Pre-Algebra Notes Unit 8: Graphs and Functions

Pre-Algebra Notes Unit 8: Graphs and Functions Pre-Algebra Notes Unit 8: Graphs and Functions The Coordinate Plane A coordinate plane is formed b the intersection of a horizontal number line called the -ais and a vertical number line called the -ais.

More information

MITOCW watch?v=w_-sx4vr53m

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

More information

Heap sort. Carlos Moreno uwaterloo.ca EIT

Heap sort. Carlos Moreno uwaterloo.ca EIT Carlos Moreno cmoreno @ uwaterloo.ca EIT-4103 http://xkcd.com/835/ https://ece.uwaterloo.ca/~cmoreno/ece250 Standard reminder to set phones to silent/vibrate mode, please! Last time, on ECE-250... Talked

More information

Project 2: How Parentheses and the Order of Operations Impose Structure on Expressions

Project 2: How Parentheses and the Order of Operations Impose Structure on Expressions MAT 51 Wladis Project 2: How Parentheses and the Order of Operations Impose Structure on Expressions Parentheses show us how things should be grouped together. The sole purpose of parentheses in algebraic

More information

3D Transformations and Complex Representations. Computer Graphics CMU /15-662, Fall 2016

3D Transformations and Complex Representations. Computer Graphics CMU /15-662, Fall 2016 3D Transformations and Complex Representations Computer Graphics CMU 15-462/15-662, Fall 2016 Quiz 4: Trees and Transformations Student solutions (beautiful!): Rotations in 3D What is a rotation, intuitively?

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

CSE/Math 456 and CSE/Math 550 Matlab Tutorial and Demo

CSE/Math 456 and CSE/Math 550 Matlab Tutorial and Demo CSE/Math 456 and CSE/Math 550 Matlab Tutorial and Demo MATLAB is very powerful and varied software package for scientific computing. It is based upon matrices and m files. It is invoked by typing % matlab

More information

MITOCW watch?v=yarwp7tntl4

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

More information

Therefore, after becoming familiar with the Matrix Method, you will be able to solve a system of two linear equations in four different ways.

Therefore, after becoming familiar with the Matrix Method, you will be able to solve a system of two linear equations in four different ways. Grade 9 IGCSE A1: Chapter 9 Matrices and Transformations Materials Needed: Straightedge, Graph Paper Exercise 1: Matrix Operations Matrices are used in Linear Algebra to solve systems of linear equations.

More information

Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That

Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That 1. Introduction You have seen situations in which the way numbers are stored in a computer affects a program. For example, in the

More information

MITOCW watch?v=0jljzrnhwoi

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

More information

Square roots: We say that the square root of 16 is 4. We write this as 16 4.

Square roots: We say that the square root of 16 is 4. We write this as 16 4. Intermediate algebra Class notes Radicals and Radical Functions (section 10.1) These are square roots, cube roots, etc. Square roots: We say that the square root of 16 is 4. We write this as 16 4. Root

More information

Math 171 Proficiency Packet on Integers

Math 171 Proficiency Packet on Integers Math 171 Proficiency Packet on Integers Section 1: Integers For many of man's purposes the set of whole numbers W = { 0, 1, 2, } is inadequate. It became necessary to invent negative numbers and extend

More information

Powered by. How did trying to give apples away for free change the world?

Powered by. How did trying to give apples away for free change the world? How did trying to give apples away for free change the world? Steve Wozniak can tell you. He put technology in the hands of the people through the invention of the modern personal computer. Leaving college

More information