Vectors Lecture 11: Supporting Material Dr Kathryn Merrick Tuesday 7 th April, 2009.

Slides:



Advertisements
Similar presentations
Insight Through Computing 10. Plotting Continuous Functions Linspace Array Operations.
Advertisements

Boolean Algebra Lecture 7: Supporting Material Dr Kathryn Merrick Tuesday 24 th March, 2009.
Maths for Computer Graphics
Arrays Revisited Selim Aksoy Bilkent University Department of Computer Engineering
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
CIS 101: Computer Programming and Problem Solving Lecture 2 Usman Roshan Department of Computer Science NJIT.
Dr. Jie Zou PHY Welcome to PHY 3320 Computational Methods in Physics and Engineering.
EGR 106 – Week 3 – More on Arrays Brief review of last week Additional ideas: – Special arrays – Changing an array – Some array operators – Character arrays.
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Module 6 Matrices & Applications Chapter 26 Matrices and Applications I.
Matrices The Basics Vocabulary and basic concepts.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices.
Part 1 Chapter 2 MATLAB Fundamentals
MATLAB Fundamentals.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
1 Introduction to MATLAB MATLAB is all of the following: 1.Computational environment 2.Plotting software 3.Programming language Typical applications: 1.Calculations.
ECON 1150 Matrix Operations Special Matrices
MATLAB Basics With a brief review of linear algebra by Lanyi Xu modified by D.G.E. Robertson.
Input and Output in MATLAB Lecture 13: Supporting Material Dr Kathryn Merrick Tuesday 14 th April, 2009.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Arrays and Fact Families
I Just Thought You Would Like to Know…
Advanced Functions Lecture 14: Supporting Material Dr Kathryn Merrick Tuesday 21 st April, 2009.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
CSE123 Lecture 5 Arrays and Array Operations. Definitions Scalars: Variables that represent single numbers. Note that complex numbers are also scalars,
Lecture 28: Mathematical Insight and Engineering.
Arrays 1 Multiple values per variable. Why arrays? Can you collect one value from the user? How about two? Twenty? Two hundred? How about… I need to collect.
Flow of Control: Loops Lecture 9: Supporting Material Dr Kathryn Merrick Tuesday 31 st March, 2009.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
Introduction to Matlab Module #2 Page 1 Introduction to Matlab Module #2 – Arrays Topics 1.Numeric arrays (creation, addressing, sizes) 2.Element-by-Element.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Introduction to MATLAB ENGR 1181 MATLAB 1. Opening MATLAB  Students, please open MATLAB now.  CLICK on the shortcut icon → Alternatively, select… start/All.
ES 240: Scientific and Engineering Computation. Chapter 2 Chapter 2: MATLAB Fundamentals Uchechukwu Ofoegbu Temple University.
Octave. Getting Started Arithmetic is as usual: – What would (a-V)(V-1)V be for a=0.1 and V=-56? – Multiplication is *, division is /
Graphical Programming Languages Lecture 19: Supporting Material Dr Kathryn Merrick Thursday 21 st May, 2009.
Programming with Spread Sheets Lecture 18: Supporting Material Dr Kathryn Merrick Tuesday 19 th May, 2009.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Sept. 5, 2012 Unit 1 UEQ.: Why is it important to know the factors of numbers? Ans.: Skip skip Concept #1 – Arrays and Factor Pairs LEQ: How do I use arrays.
Chapter 2 Creating Arrays Legend: MATLAB command or syntax : Blue MATLAB command OUTPUT : LIGHT BLUE.
Part 1 Chapter 2 MATLAB Fundamentals PowerPoints organized by Dr. Michael R. Gustafson II, Duke University and Prof. Steve Chapra, Tufts University All.
Array Creation ENGR 1181 MATLAB 2. Civil engineers store seismic data in arrays to analyze plate tectonics as well as fault patterns. These sets of data.
Array Creation ENGR 1187 MATLAB 2. Today’s Topics  Arrays: What are they?  Vectors  Matrices  Creating Arrays.
Understanding Multiplication and Division.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
By: Tameicka James Addition Subtraction Division Multiplication
Project Teams Project on Diffusion will be a TEAM project. 34 Students in class so 6 teams of 5 and one Team of 4. Determine members of team and a team.
ENG College of Engineering Engineering Education Innovation Center 1 Array Operations in MATLAB 1.Types of Matrix arithmetic 2.Dot operators Mathematical.
CS100A, Fall 1998, Lecture 201 CS100A, Fall 1998 Lecture 20, Tuesday Nov 10 More Matlab Concepts: plotting (cont.) 2-D arrays Control structures: while,
Array and Matrix Operations EE 201 Fall  Achieve Comprehension LOL of Array and Matrix Operations. Class Learning Objectives 2.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
ENG College of Engineering Engineering Education Innovation Center 1 Arrays in MATLAB Topics Covered: 1.Creating arrays of numbers vectors matrices.
Matrices. Matrix A matrix is an ordered rectangular array of numbers. The entry in the i th row and j th column is denoted by a ij. Ex. 4 Columns 3 Rows.
LAB 2 Vectors and Matrices Dr.Abdel Fattah FARES.
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices.
MTH108 Business Math I Lecture 20.
Linear Algebraic Equations and Matrices
Linear Algebra Lecture 2.
JE’PARDY! MATH
Linear Algebraic Equations and Matrices
1 Step Equation Practice + - x ÷
Vectors and Matrices I.
Arrays and Matrices in MATLAB
Introduction to Matrices
Presentation transcript:

Vectors Lecture 11: Supporting Material Dr Kathryn Merrick Tuesday 7 th April, 2009

Overview What is a vector? Creating vectors Accessing vectors Manipulating data in vectors Implicit vectorisation Reference: text book Ch 5

A Motivating Experiment:

Creating Vectors

Listing Elements >> my_vector = [ ]; or >> my_vector = [1, 4, 30, 2, 6];

>> my_vector = [1:10]; or >> my_vector = [1:0.1:10]; or >> my_vector = 1:0.1:10; Using the Colon Operator :

Using a Built-in Function >> x = 0:0.1:2*pi; >> my_vector = sin(x); Or >> x = [0:10]; >> my_vector = x*5;

Using linspace or logspace linspace(x, y) generates 100 equally spaced points between x and y >> my_vector = linspace(1, 100) linspace(x, y, n) generates n equally spaced points between x and y >> my_vector = linspace(1, 100, 10)

Column Vectors >> a = [1; 2; 3; 4; 5] >> a = [ ]

Transposing a Row Vector >> a = [ ] a = >> b = a' b =

Demo 1: Accessing Data in Vectors

Accessing One or More Values Accessing Individual Values >> value = my_vector(5); Accessing Multiple Values >> values = my_vector([ ]);

Demo 2: Manipulating Vectors

Manipulating Vectors: Basic Maths

Scalar-Array Maths Example >> x = [0:10]; y = x + 5; Or >> x = [0:10]; y = x * 5;

Basic Array Maths Addition >> a = [2 3]; >> b = [4 5]; >> c = a + b c = 6 8 Subtraction >> a = [2 3]; >> b = [4 5]; >> c = a - b c = -2 -2

Basic Array Maths Multiplication >> a = [2 3]; >> b = [4 5]; >> c = a.* b c = 8 15 Division >> a = [2 3]; >> b = [4 5]; >> c = a./ b c = Power >> a = [2 3]; >> b = [4 5]; >> c = a.^ b c =

Summary After today’s lecture you should be able to: Create and access data in vectors Manipulate data in vectors using loops or implicit vectorisation