Array and Matrix Functions

Slides:



Advertisements
Similar presentations
4.1 Introduction to Matrices
Advertisements

Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Maths for Computer Graphics
CIS 101: Computer Programming and Problem Solving Lecture 2 Usman Roshan Department of Computer Science NJIT.
EGR 106 – Week 4 – Math on Arrays
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Matlab Intro. Outline Matlab introduction Matlab elements Types Variables Matrices.
Intro to Matrices Don’t be scared….
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
A matrix having a single row is called a row matrix. e.g.,
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
ECON 1150 Matrix Operations Special Matrices
Hadamard matrices and the hadamard conjecture
Matlab Chapter 2: Array and Matrix Operations. What is a vector? In Matlab, it is a single row (horizontal) or column (vertical) of numbers or characters.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Array Addition  Two arrays can be added if and only if both arrays have exactly the same dimensions.  Assuming the dimension requirement is satisfied,
1 1.4 Linear Equations in Linear Algebra THE MATRIX EQUATION © 2016 Pearson Education, Inc.
Learner’s Guide to MATLAB® Chapter 2 : Working with Arrays.
Chapter 2 Numeric, Cell, and Structure Arrays. Physics Connection - Specification of a position vector using Cartesian coordinates. Figure 2.1–1 2-2 The.
13.1 Matrices and Their Sums
When data from a table (or tables) needs to be manipulated, easier to deal with info in form of a matrix. Matrices FreshSophJunSen A0342 B0447 C2106 D1322.
4.4 Identify and Inverse Matrices Algebra 2. Learning Target I can find and use inverse matrix.
Chapter 2 Creating Arrays Legend: MATLAB command or syntax : Blue MATLAB command OUTPUT : LIGHT BLUE.
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.
Chapter 2 Numeric, Cell, and Structure Arrays. Physics Connection - Specification of a position vector using Cartesian coordinates. Figure 2.1–1 2-2 The.
Section 1.7 Linear Independence and Nonsingular Matrices
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
2.5 – Determinants and Multiplicative Inverses of Matrices.
Digital Image Processing. Converting between Data Classes The general syntax is B = data_class_name (A) Where data_class_name is one of the names defined.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
2.1 Matrix Operations 2. Matrix Algebra. j -th column i -th row Diagonal entries Diagonal matrix : a square matrix whose nondiagonal entries are zero.
LAB 2 Vectors and Matrices Dr.Abdel Fattah FARES.
Linear Algebra by Dr. Shorouk Ossama.
REVIEW Linear Combinations Given vectors and given scalars
MTH108 Business Math I Lecture 20.
Matrix Algebra MATRIX OPERATIONS © 2012 Pearson Education, Inc.
Introduction to MATLAB for Engineers, Third Edition
Linear Algebra review (optional)
Linear Equations in Linear Algebra
Copyright © 2009 Dan Nettleton
Introduction to MATLAB 7
MATHEMATICS Matrix Algebra
Introduction to Matrices
Math. 375, Fall Matrices and Vectors
MATHEMATICS Matrix Multiplication
What we’re learning today:
Matrix Algebra MATRIX OPERATIONS © 2012 Pearson Education, Inc.
L5 matrix.
EGR 106 – Week 4 – Math on Arrays
Dr. Ameria Eldosoky Discrete mathematics
7.3 Matrices.
Linear Equations in Linear Algebra
2. Matrix Algebra 2.1 Matrix Operations.
Digital Image Processing
2.2 Introduction to Matrices
Arrays and Matrices in MATLAB
Matlab Intro.
Presented By Farheen Sultana Ist Year I SEM
Matrices.
3.5 Perform Basic Matrix Operations
Multiplication of Matrices
Linear Algebra review (optional)
Introduction to MATLAB 7
Chapter 4 Matrices & Determinants
Matrices.
Matrix Algebra MATRIX OPERATIONS © 2012 Pearson Education, Inc.
Matlab Intro.
Presentation transcript:

Array and Matrix Functions EE 201 Fall 2013

Class Learning Objectives Achieve Comprehension LOL of Array and Matrix Functions . C4-1 Spring 2012

Array Functions I=find(V) returns the linear indices corresponding to the nonzero entries of the array V. C4-1 Spring 2012

Example: C4-1 Spring 2012

Example C4-1 Spring 2012

Array Functions length(A) Computes either the number of elements of A if A is a vector or the largest value of m or n if A is an m × n matrix. length(A) C4-1 Spring 2012

Example C4-1 Spring 2012

Array Functions max(A) Returns the algebraically largest element in A if A is a vector.   Returns a row vector containing the largest elements in each column if A is a matrix. C4-1 Spring 2012

Array Functions min(A) Returns the algebraically smallest element in A if A is a vector.   Returns a row vector containing the smallest elements in each column if A is a matrix. . min(A) C4-1 Spring 2012

Array Functions size(A) sort(A) sum(A) Returns a row vector [m n] containing the sizes of the m x n array A. size(A) Sorts each column of the array A in ascending order and returns an array the same size as A. sort(A) Sums the elements in each column of the array A and returns a row vector containing the sums. sum(A) C4-1 Spring 2012

For example, if A= -max(A) [6,2] -min(A) [-10,-5] -length(A) 3 -size(A) [3,2] -length(A) 3 -sort (A) -10 -5 3 0 6 2 -sum(A) -1 -3 C4-1 Spring 2012

Sometimes we want to initialize a matrix to have all zero elements Sometimes we want to initialize a matrix to have all zero elements. The zeros command creates a matrix of all zeros. Typing zeros(n) creates an n × n matrix of zeros, whereas typing zeros(m,n) creates an m × n matrix of zeros. Typing zeros(size(A)) creates a matrix of all zeros having the same dimension as the matrix A. This type of matrix can be useful for applications in which we do not know the required dimension ahead of time. The syntax of the ones command is the same, except that it creates arrays filled with ones. C4-1 Spring 2012

Generating Vectors from functions zeros(m,n) mxn matrix of zeros ones(m,n) mxn matrix of ones x = zeros(1,3) x = 0 0 0 x = ones(1,3) 1 1 1

Example: C4-1 Spring 2012

The identity matrix is a square matrix whose diagonal elements are all equal to one, with the remaining elements equal to zero. For example, the 4 × 4 identity matrix is 1 0 0 0 I= 0 1 0 0 0 0 1 0 0 0 0 1 The functions eye(n) and eye(size(A)) create an n × n identity matrix and an identity matrix the same size as the matrix A. C4-1 Spring 2012

Example: C4-1 Spring 2012