Arrays in MatLab Arrays can have any number dimensions

Slides:



Advertisements
Similar presentations
This algorithm is used for dimension reduction. Input: a set of vectors {Xn є }, and dimension d,d
Advertisements

Maths for Computer Graphics
Arrays (Part II). Two- and Multidimensional Arrays Two-dimensional array: collection of a fixed number of components (of the same type) arranged in two.
Subspaces, Basis, Dimension, Rank
Module 6 Matrices & Applications Chapter 26 Matrices and Applications I.
Matrix Definition A Matrix is an ordered set of numbers, variables or parameters. An example of a matrix can be represented by: The matrix is an ordered.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Portfolio Statistics  Portfolio Expected Return: E(r p ) = w T r  Portfolio Variance:  2 p = w T  w  Sum of portfolio weights: = w T 1 –where w is.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
13.1 Matrices and Their Sums
Two dimensional arrays in Java Computer Science 3 Gerb Objective: Use matrices in Java.
Chapter 4 Review: Manipulating Matrices Introduction to MATLAB 7 Engineering 161.
Class Opener:. Identifying Matrices Student Check:
ENG College of Engineering Engineering Education Innovation Center 1 Array Accessing and Strings in MATLAB Topics Covered: 1.Array addressing. 2.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
Unit 1 MATRICES Dr. Shildneck Fall, WHAT IS A MATRIX? A Matrix is a rectangular array of numbers placed inside brackets. A Matrix is a rectangular.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Do Now: Perform the indicated operation. 1.). Algebra II Elements 11.1: Matrix Operations HW: HW: p.590 (16-36 even, 37, 44, 46)
LAB 2 Vectors and Matrices Dr.Abdel Fattah FARES.
Two dimensional arrays.
13.4 Product of Two Matrices
Linear Algebra review (optional)
Manipulating MATLAB Matrices Chapter 4
Two-Dimensional Arrays
Chapter 7 Matrix Mathematics
Two Dimensional Arrays
Introduction to Matrices
EGR 115 Introduction to Computing for Engineers
2) Platform independent 3) Predefined functions
Matrices SSP 2017.
Matrix Operations SpringSemester 2017.
WarmUp 2-3 on your calculator or on paper..
7.3 Matrices.
Introduction to Matrices
Warmup Solve each system of equations. 4x – 2y + 5z = 36 2x + 5y – z = –8 –3x + y + 6z = 13 A. (4, –5, 2) B. (3, –2, 4) C. (3, –1, 9) D. no solution.
Matrices Elements, Adding and Subtracting
Vectors and Matrices I.
Digital Image Processing
CSCI N207 Data Analysis Using Spreadsheet
Determinants 2 x 2 and 3 x 3 Matrices.
2.2 Introduction to Matrices
Communication and Coding Theory Lab(CS491)
Lecture 4 2d Arrays CSE /26/2018.
Unit 1 MATRICES Dr. Shildneck Fall, 2015.
Matlab Intro.
Multidimensional array
Presented By Farheen Sultana Ist Year I SEM
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Dr Tripty Singh Arrays.
Lets Play with arrays Singh Tripty
Basics of Linear Algebra
Multi-Dimensional Arrays
Introduction to Matlab
Matlab Training Session 2: Matrix Operations and Relational Operators
Determinants 2 x 2 and 3 x 3 Matrices.
3.6 Multiply Matrices.
2-Dimensional Lists (Matrices) in Python
Two dimensional arrays.
Linear Algebra review (optional)
Determinants 2 x 2 and 3 x 3 Matrices.
EECS Introduction to Computing for the Physical Sciences
Determinants 2 x 2 and 3 x 3 Matrices.
Matrices.
Matrix Operations SpringSemester 2017.
Matrix A matrix is a rectangular arrangement of numbers in rows and columns Each number in a matrix is called an Element. The dimensions of a matrix are.
Working with Arrays in MATLAB
General Computer Science for Engineers CISC 106 Lecture 11
Matlab Intro.
Announcements.
Announcements Exam 2 Next Week!! Final Exam :
Presentation transcript:

Arrays in MatLab Arrays can have any number dimensions The dimension of an array is the number of indices required to specify an element of the array. Most of the arrays that you will encounter in this class have 1 or 2 dimension. 1-dimensional arrays are called “vectors” 2-dimensional arrays are called “matrices” The “length” or “size” of an array is the number of elements in the array. MatLab does not require specification of array size before it is used.

Arrays in MatLab x=linspace(-1,4,10); produces a “row” vector (i.e. 1xn matrix) >>disp(x) displays the elements in x in rows If x is a row vector, then x’ is a “column” vector (i.e. nx1 matrix) >>disp(x’) displays the elements in x as a column The rows of a matrix M can be use as row-vectors M(k, :) The columns of a matrix M can be use a column-vectors M(:, k)

Arrays in MatLab x=linspace(-1,4,10); produces a “row” vector (i.e. 1xn matrix) If a row vector is passed to a function, MatLab returns a row vector. If a column vector is passed to a function, MatLab returns a column vector. >>myf=inline(‘exp(x)-3*x.^2’); is setup to receive vector input x.^2 means square vector x “component by component” It will work on any size of x, including size=1, which we usually call a “scaler” >>myf=@(x) exp(x)-3*x.^2 is equivalent to the inline definition of myf. The components in a call to disp (e.g. disp([x,y,z])) must all be the same size.

Arrays in MatLab x=linspace(-1,4,10); To specify components of x in a calculation, use x(index). Note .^ unnecessary The for loop defined a row vector

Arrays in MatLab x=linspace(-1,4,10); To specify components of x in a calculation, use x(index). The for loop defined a row vector even though x was a column vector because my calculation only involved components of x.