Array and Matrix Operations EE 201 Fall 20131.  Achieve Comprehension LOL of Array and Matrix Operations. Class Learning Objectives 2.

Slides:



Advertisements
Similar presentations
2.3 Modeling Real World Data with Matrices
Advertisements

Section 13-4: Matrix Multiplication
Chapter Matrices Matrix Arithmetic
Introduction to Matlab
Slide deck by Dr. Greg Reese Miami University MATLAB An Introduction With Applications, 5 th Edition Dr. Amos Gilat The Ohio State University Chapter 3.
Maths for Computer Graphics
Chapter 2 Matrices Definition of a matrix.
Ch 7.2: Review of Matrices For theoretical and computation reasons, we review results of matrix theory in this section and the next. A matrix A is an m.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Fall 2006AE6382 Design Computing1 Relational and Logical Operators Use relational operators to test two values Work with values of true and false Compare.
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
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.
Table of Contents Matrices - Multiplication Assume that matrix A is of order m  n and matrix B is of order p  q. To determine whether or not A can be.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Modified Gary Larson Far Side cartoon
1 Chapter 3 Matrix Algebra with MATLAB Basic matrix definitions and operations were covered in Chapter 2. We will now consider how these operations are.
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.
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 10 Review: Matrix Algebra
ENGR-25_Arrays-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
MATLAB Basics With a brief review of linear algebra by Lanyi Xu modified by D.G.E. Robertson.
Array Math.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Matlab Review Exam 2 – Oct 28, Exam Reminders Open book. Only Matlab book, no notes or loose papers in book. Open book. Only Matlab book, no notes.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
1 Week 3: Vectors and Matrices (Part III) READING: 2.2 – 2.4 EECS Introduction to Computing for the Physical Sciences.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Chapter 2 Numeric, Cell, and Structure Arrays. Physics Connection - Specification of a position vector using Cartesian coordinates. Figure 2.1–1 2-2 The.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
CMPS 1371 Introduction to Computing for Engineers MATRICES.
Lecture 28: Mathematical Insight and Engineering.
Matrices. Definitions  A matrix is an m x n array of scalars, arranged conceptually as m rows and n columns.  m is referred to as the row dimension.
Introduction to Matlab
Recap Saving Plots Summary of Chapter 5 Introduction of Chapter 6.
1 Matrix Operation ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
ES 240: Scientific and Engineering Computation. Chapter 8 Chapter 8: Linear Algebraic Equations and Matrices Uchechukwu Ofoegbu Temple University.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
Slide Copyright © 2009 Pearson Education, Inc. 7.3 Matrices.
Matrix Algebra Section 7.2. Review of order of matrices 2 rows, 3 columns Order is determined by: (# of rows) x (# of columns)
8.2 Operations With Matrices
MATLAB Jirawat Kanjanapitak (Tae). What is MATLAB A computer program for doing numerical computation including; Arithmetic, Polynomials, Graphics, 2-D.
3.4 Solution by Matrices. What is a Matrix? matrix A matrix is a rectangular array of numbers.
Unit 3 Matrix Arithmetic IT Disicipline ITD 1111 Discrete Mathematics & Statistics STDTLP 1 Unit 3 Matrix Arithmetic.
Chapter 2 Numeric, Cell, and Structure Arrays. Physics Connection - Specification of a position vector using Cartesian coordinates. Figure 2.1–1 2-2 The.
Algebra Matrix Operations. Definition Matrix-A rectangular arrangement of numbers in rows and columns Dimensions- number of rows then columns Entries-
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
Finishing up Chapter 5. Will this code enter the if statement? G=[30,55,10] if G
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
ENG College of Engineering Engineering Education Innovation Center 1 Array Operations in MATLAB 1.Types of Matrix arithmetic 2.Dot operators Mathematical.
Do Now: Perform the indicated operation. 1.). Algebra II Elements 11.1: Matrix Operations HW: HW: p.590 (16-36 even, 37, 44, 46)
Precalculus Section 14.1 Add and subtract matrices Often a set of data is arranged in a table form A matrix is a rectangular.
Matrices. Matrix - a rectangular array of variables or constants in horizontal rows and vertical columns enclosed in brackets. Element - each value in.
Matrix Algebra Definitions Operations Matrix algebra is a means of making calculations upon arrays of numbers (or data). Most data sets are matrix-type.
To add, subtract, multiply, and divide, absolutely follow the mathematical rules. 1. All the rules 2. The element-per-element operator 3. Ex1: graphing.
Relational and Logical Operators EE 201 1C7-2 Spring 2012.
A very brief introduction to Matrix (Section 2.7) Definitions Some properties Basic matrix operations Zero-One (Boolean) matrices.
13.4 Product of Two Matrices
Introduction to MATLAB for Engineers, Third Edition
12-1 Organizing Data Using Matrices
Introduction to MATLAB 7
Matrix Multiplication
Unit 3: Matrices
3.6 Multiply Matrices.
Introduction to MATLAB 7
Matrix Multiplication Sec. 4.2
Presentation transcript:

Array and Matrix Operations EE 201 Fall 20131

 Achieve Comprehension LOL of Array and Matrix Operations. Class Learning Objectives 2

MATLAB has two forms of arithmetic operations on arrays: 1- array operations, which are also called element-by-element 2- matrix operations. 3

Operators (arithmetic) +addition -subtraction *multiplication /division ^power ‘complex conjugate transpose

Matrices Operations Given A and B: AdditionSubtractionProductTranspose

6

Operators (Element by Element).*element-by-element multiplication./element-by-element division.^element-by-element power

Array or Element-by-element multiplication(.* ) is defined only for arrays having the same size. The definition of the product x.*y, where x and y each have n elements, is x.*y = [x(1)y(1), x(2)y(2),..., x(n)y(n)] if x and y are row vectors. For example, if x = [2, 4, - 5] ; y = [- 7, 3, - 8]; >>z = x.*y gives: ans = -14, 12, 40 z = [2(- 7), 4 (3), -5(-8)] = [-14, 12, 40] 8

The built-in MATLAB functions such as : sqrt(x) and exp(x) automatically operate on array arguments to produce an array result the same size as the array argument x. Thus these functions are said to be vectorized functions. For example, in the following session the result y has the same size as the argument x. >>x = [4, 16, 25]; >>y = sqrt(x) y = 245 9

However, when multiplying or dividing these functions, or when raising them to a power, you must use element-by- element (. ) operations if the arguments are arrays. For example, to compute: z = (e y sin x) cos 2 x, you must type z = exp(y).*sin(x).*(cos(x)).^2 You will get an error message if the size of x is not the same as the size of y. The result z will have the same size as x and y. 10

Array Division (./ ) The definition of array division is similar to the definition of array multiplication except that the elements of one array are divided by the elements of the other array. Both arrays must have the same size. The symbol for array right division is (./ ). For example, if x = [8, 12, 15] y = [-2, 6, 5] Then >>z = x./y Gives z = [8/(-2), 12/6, 15/5] = [-4, 2, 3] 11

Also, if A = Then – B = -3 2 >>C = A./B gives C = 24/(-4) 20/5 -9/-3 4/ =

Matrix-Matrix Multiplication ( * ) In the product of two matrices AB, the number of columns in A must equal the number of rows in B. The row-column multiplications form column vectors, and these column vectors form the matrix result. The product AB has the same number of rows as A and the same number of columns as B. For example: –5 12 (6)(9) + (- 2)(- 5) = (10)(9) + (3)(- 5) (4)(9) + (7)(- 5) = (6)(8) + (- 2)(12) (10)(8) + (3)(12) (4)(8) + (7)(12) 13

Use the operator ( * ) to perform matrix multiplication in MATLAB. The following MATLAB commands show how to perform the matrix >>A = [6,-2;10,3;4,7]; >>B = [9,8;-5,12]; >>A*B ans =

Application 15 Table shows the hourly cost of four types of manufacturing processes. It also shows the number of hours required of each process to produce three different products. Write a MATLAB program to solve the following: Hours required to produce one unit Process Hourly cost($) Product 1Product 2Product 3 Lathe10654 Grinding12231 Milling14325 Welding9403

a-Determine the cost of each process to produce one unit of product 1? b-Determine the cost to make one unit of each product? c-Suppose we produce 10 units of product 1,5 units of product 2, and 7 units of product 3 compute the total cost? 16

Solution : 17

18