Solution of Linear systems

Similar documents
1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

Fundamentals of Engineering Analysis (650163)

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

Lecture 12. Linear systems of equations II. a 13. a 12. a 14. a a 22. a 23. a 34 a 41. a 32. a 33. a 42. a 43. a 44)

2.1 Gaussian Elimination

Linear Algebraic Equations

LECTURE 12: SOLUTIONS TO SIMULTANEOUS LINEAR EQUATIONS. Prof. N. Harnew University of Oxford MT 2012

Systems of Linear Equations

Linear Systems of n equations for n unknowns

The matrix will only be consistent if the last entry of row three is 0, meaning 2b 3 + b 2 b 1 = 0.

Lecture 12 (Tue, Mar 5) Gaussian elimination and LU factorization (II)

MATRICES The numbers or letters in any given matrix are called its entries or elements

1.Chapter Objectives

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

Undergraduate Mathematical Economics Lecture 1

A Review of Matrix Analysis

Linear Systems and Matrices

Linear Equations and Matrix

Practical Linear Algebra: A Geometry Toolbox

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Linear Algebraic Equations

Matrix decompositions

Chapter 2 Notes, Linear Algebra 5e Lay

Graduate Mathematical Economics Lecture 1

MATH2210 Notebook 2 Spring 2018

Conceptual Questions for Review

MATH 3511 Lecture 1. Solving Linear Systems 1

MAC Module 3 Determinants. Learning Objectives. Upon completing this module, you should be able to:

Linear Algebra: Lecture notes from Kolman and Hill 9th edition.

CHAPTER 8: Matrices and Determinants

Lecture Notes in Linear Algebra

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

Engineering Computation

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Direct Methods for Solving Linear Systems. Matrix Factorization

Matrix decompositions

Numerical Linear Algebra

y b where U. matrix inverse A 1 ( L. 1 U 1. L 1 U 13 U 23 U 33 U 13 2 U 12 1

MATRICES AND MATRIX OPERATIONS

Lemma 8: Suppose the N by N matrix A has the following block upper triangular form:

Chapter 2: Approximating Solutions of Linear Systems

Lesson 3. Inverse of Matrices by Determinants and Gauss-Jordan Method

Equality: Two matrices A and B are equal, i.e., A = B if A and B have the same order and the entries of A and B are the same.

c c c c c c c c c c a 3x3 matrix C= has a determinant determined by

Linear Algebra Linear Algebra : Matrix decompositions Monday, February 11th Math 365 Week #4

1 Determinants. 1.1 Determinant

Quiz ) Locate your 1 st order neighbors. 1) Simplify. Name Hometown. Name Hometown. Name Hometown.

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 6

Gaussian Elimination and Back Substitution

Determinants Chapter 3 of Lay

Extra Problems: Chapter 1

TOPIC III LINEAR ALGEBRA

MTH501- Linear Algebra MCQS MIDTERM EXAMINATION ~ LIBRIANSMINE ~

Matrices and Determinants

The Solution of Linear Systems AX = B

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

Review Questions REVIEW QUESTIONS 71

CHAPTER 6. Direct Methods for Solving Linear Systems

Gaussian Elimination without/with Pivoting and Cholesky Decomposition

Lecture 10: Determinants and Cramer s Rule

Introduction to Determinants

Determinants. Samy Tindel. Purdue University. Differential equations and linear algebra - MA 262

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.

Lecture 12 Simultaneous Linear Equations Gaussian Elimination (1) Dr.Qi Ying

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

ENGI 9420 Lecture Notes 2 - Matrix Algebra Page Matrix operations can render the solution of a linear system much more efficient.

8-15. Stop by or call (630)

Review of Matrices and Block Structures

12/1/2015 LINEAR ALGEBRA PRE-MID ASSIGNMENT ASSIGNED BY: PROF. SULEMAN SUBMITTED BY: M. REHAN ASGHAR BSSE 4 ROLL NO: 15126

Review of Vectors and Matrices

Chapter 3. Determinants and Eigenvalues

Process Model Formulation and Solution, 3E4

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

Math Linear Algebra Final Exam Review Sheet

Appendix C Vector and matrix algebra

4. Determinants.

Hani Mehrpouyan, California State University, Bakersfield. Signals and Systems

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

MTH 102A - Linear Algebra II Semester

A Brief Outline of Math 355

COURSE Numerical methods for solving linear systems. Practical solving of many problems eventually leads to solving linear systems.

Section Matrices and Systems of Linear Eqns.

18.06 Problem Set 2 Solution

Computational Methods. Systems of Linear Equations

Linear System of Equations

SAMPLE OF THE STUDY MATERIAL PART OF CHAPTER 1 Introduction to Linear Algebra

Determinants: summary of main results

Inverses and Determinants

Review. Example 1. Elementary matrices in action: (a) a b c. d e f = g h i. d e f = a b c. a b c. (b) d e f. d e f.

Methods for Solving Linear Systems Part 2

5.7 Cramer's Rule 1. Using Determinants to Solve Systems Assumes the system of two equations in two unknowns

MATH 2030: MATRICES. Example 0.2. Q:Define A 1 =, A. 3 4 A: We wish to find c 1, c 2, and c 3 such that. c 1 + c c

Matrix notation. A nm : n m : size of the matrix. m : no of columns, n: no of rows. Row matrix n=1 [b 1, b 2, b 3,. b m ] Column matrix m=1

Elementary maths for GMT

Phys 201. Matrices and Determinants

EC5555 Economics Masters Refresher Course in Mathematics September 2014

Linear System Equations

Transcription:

Solution of Linear systems Direct Methods Indirect Methods -Elimination Methods -Inverse of a matrix -Cramer s Rule -LU Decomposition Iterative Methods 2

A x = y Works better for coefficient matrices with no or few zeros Coefficient matrix A is augmented with the y matrix Good if A i,j ~ y i, Not good if the elements of y are too different from those of A The goal is to: obtain an upper triangular matrix (lower triangular part all zeros) by forward elimination of the coefficients below the diagonal coefficients Get the values of x by back substitution 3

(1) a 1,1 x 1 + a 1,2 x 2 + + a 1,n x n = y 1 (2) a 2,1 x 1 + a 2,2 x 2 + + a 2,n x n = y 2.. (n) a n,1 x 1 + a n,2 x 2 + + a n,n x n = y n Forward elimination: Eliminate the 1st term a n,1 x 1 of all rows below the 1st row, for n>1: Multiply Eq(1) by a n,1 /a 1,1 Subtract from all equations as n=2:n 4

First elimination: (1) a 1,1 x 1 + a 1,2 x 2 + + a 1,n x n = y 1 (2) 0 + a 2,2 x 2 + + a 2,n x n = y 2 (n) 0 + a n,2 x 2 + + a n,n x n = y n For i >1 a a ' a a i,1 i, j i, j 1, j a1,1 a i,1 y ' i yi y1 a1,1 5

Second elimination: (1) a 1,1 x 1 + a 1,2 x 2 + a 1,3 x 3 + + a 1,n x n = y 1 (2) 0 + a 2,2 x 2 + a 2,3 x 3 + + a 2,n x n = y 2 (3) 0 + 0 + a 3,3 x 3 + + a 3,n x n = y 3 (n) (n-1) 0 + 0 + 0 + + a (n-1) n,nx n = y (n-1) n For i >2 a ' a '' a ' a ' i,2 i, j i, j 2, j a ' 2,2 a ' y y y i,2 '' i ' i ' 2 a ' 2,2 6

Back substitution: Forward elimination Upper triangular matrix The last equation is a (n-1) n,nx n = y (n-1) n x x n... x ( n1) n ( n1) nn, ( n2) ( n2) n1 n1, n n n1 ( n2) an 1, n1 1 y a y y a x n 1 1, i i2 a 1,1 a x i 7

Assume m n (1) a 1,1 x 1 + a 1,2 x 2 + + a 1,n x n = y 1 (2) a 2,1 x 1 + a 2,2 x 2 + + a 2,n x n = y 2.. (m) a m,1 x 1 + a m,2 x 2 + + a m,n x n = y m Check if a 1,1 =0, if so reorganize, then Multiply Eqn. (1) by a i,1 /a 1,1 Subtract from all equations as i=2:m Repeat this procedure until the elements under a i,i are all 0 8

If the original equations are not all linearly independent, Reduced equations may be: (1) a 1,1 x 1 + a 1,2 x 2 + + a 1,n x n = y 1 (2) a 2,2 x 2 + + a 2,n x n = y 2.. (m) a m,m x m + + a m,n x n = y m Family of possible solutions with m variables 9

If elimination ends before the upper triangular matrix is obtained: (1) a 1,1 x 1 + a 1,2 x 2 + + a 1,n x n = y 1 (2) a 2,2 x 2 + + a 2,n x n = y 2 (..) (k) a k,k x k + a k,k+1 x k+1 + + a k,n x n = y k (k+1) 0 = y k+1 (..) (m) 0 = y m Family of possible solutions if n>k and y k+1,,y m = 0 Unique solution if n=k and y k+1,,y m = 0 Inconsistent equations if at least one of y k+1,,y m 0 10

1 1 3 1 (1) 1 2 5 2 (2) 3 1 5 1 (3) 1 1 3 1 (1) 0 1 2 1 (2') (2) (1) 0 2 4 4 (3') (3) 3(1) 1 1 3 1 (1) 0 1 2 1 (2') 0 0 0 2 (3'') (3') 2(2') Augmented matrix [A, y] First elimination Second elimination Result 0=-2 shows the equations are inconsistent Det(A)=0 11

If a diagonal element (or coefficient) a i,i becomes zero: Forward elimination process cannot proceed If diagonal coefficients are not zero: Pivoting helps to increase the accuracy of solution Pivoting: Exchange the order of equations such that the diagonal coef. a i,i becomes larger in magnitude than any other element in the column 1st pivoting before 1st elimination: Compare if a 1,1 >= a i,1, if NOT exchange rows to make diagonal coefficient largest 2nd pivoting before 2nd elimination: Compare if a 2,2 >= a i,2 12

For successful operations in Gauss elimination: Diagonal elements A i,i 0 Reorganize the initial matrix to perform all necessary operations successfully A= After pivoting -2 4 1 2 5 1 3 10-6 7 0 9-6 7 0 9 5 1 3 10-2 4 1 2 13

Solve the following set of linear equations: -2 x 1 + 4 x 2 + x 3 = 2 5 x 1 + x 2 + 3 x 3 = 10-6 x 1 + 7 x 2 = 9 Solution: a x = y, -2 4 1 x 1 2 5 1 3 x 2 = 10-6 7 0 x 3 9 14

%Solve 3 linear equations for 3 unknowns by Gauss Elimination and Pivoting %The augmented matrix is: a=[-2 4 1 2; 5 1 3 10; -6 7 0 9]; %First pivoting (Exchange Eqn.1 with Eqn.3): tempo=a(1,:); a(1,:)=a(3,:); a(3,:)=tempo; a %First elimination: Multiply Eqn.1 by a(2,1)/a(1,1) and subtract from Eqn.2 a(2,:)=a(2,:)-a(1,:)*a(2,1)/a(1,1); %Multiply Eqn.1 by a(3,1)/a(1,1) and subtract Eqn.3 a(3,:)=a(3,:)-a(1,:)*a(3,1)/a(1,1); a %No more pivoting is required. 2nd elimination: %Multiply Eqn.2 by a(3,2)/a(2,2) and subtract from Eqn.3 a(3,:)=a(3,:)-a(2,:)*a(3,2)/a(2,2); a %Forward elimination is done! Now backward substitution: x(3)=a(3,4)/a(3,3); x(2)=(a(2,4)-a(2,3)*x(3))/a(2,2); x(1)=(a(1,4)-a(1,3)*x(3)-a(1,2)*x(2))/a(1,1); x 15

After Pivoting a= -6 7 0 9 5 1 3 10-2 4 1 2 First elimination: a = -6.00000000000000 7.00000000000000 0 9.00000000000000 0 6.83333333333333 3.00000000000000 17.50000000000000 0 1.66666666666667 1.00000000000000-1.00000000000000 Second elimination: a = -6.00000000000000 7.00000000000000 9.00000000000000 0 0 6.83333333333333 3.00000000000000 17.50000000000000 0 0 0.26829268292683-5.26829268292683 Back Substitution and Solution: x = 11.54545454545455 11.18181818181818-19.63636363636364 16

Write a MATLAB program to calculate the solution x for Ax=y using Gauss elimination method (with pivoting and normalization), where A is a coefficient matrix of any size. Hints: Use m-files to create a general function Make use of loops and if statements as necessary 17

A x = y matrix is augmented [A y] All rows are pivoted and normalized by dividing by the pivot elements Coefficients both below and above the diagonal matrix are eliminated The goal is to: Obtain an identity matrix for A, i.e. [A y] [ I y new ] Get the unknown variables directly from [ I y new ] No back substitution for the unknown variables Direct solution but requires more calculations than Gauss elimination 18

%Solve 3 linear equations for 3 unknowns by Gauss-Jordan Elimination A=[-2 4 1 2; 5 1 3 10; -6 7 0 9]; %Pivoting for the first row (exchanging the 1st and 3rd rows): tempo=a(1,:); A(1,:)=A(3,:); A(3,:)=tempo; %Normalizing the 1st row (Dividing by its pivot): A(1,:)=A(1,:)/A(1,1); %Eliminating the elements below the 1st diagonal: for i=2:3, A(i,:)=A(i,:)-A(i,1)*A(1,:); end, A %No more pivoting is required. Normalizing the 2nd row: A(2,:)=A(2,:)/A(2,2); A %Eliminating the elements above and below the 2nd diagonal: for i=1:3, if i~=2, A(i,:)=A(i,:)-A(i,2)*A(2,:); end end, A %Normalizing the 3rd row: A(3,:)=A(3,:)/A(3,3); %Eliminating the elements above the 3rd diagonal for i=1:2, A(i,:)=A(i,:)-A(i,3)*A(3,:); end, A 19

After Pivoting A= -6 7 0 9 5 1 3 10-2 4 1 2 Normalizing Equation 1 and First elimination: A = 1.00000000000000-1.16666666666667 0-1.50000000000000 0 6.83333333333333 3.00000000000000 17.50000000000000 0 1.66666666666667 1.00000000000000-1.00000000000000 Normalizing Equation 2 A = 1.00000000000000-1.16666666666667 0-1.50000000000000 0 1.00000000000000 0.43902439024390 2.56097560975610 0 1.66666666666667 1.00000000000000-1.00000000000000 20

Second elimination: A= 1.00000000000000 0 0.51219512195122 1.48780487804878 0 1.00000000000000 0.43902439024390 2.56097560975610 0 0 0.26829268292683-5.26829268292683 Normalizing Equation 3 and third elimination: A = 1.00000000000000 0 0 11.54545454545454 0 1.00000000000000 0 11.18181818181818 0 0 1.00000000000000-19.63636363636363 Solution: [I][x]=[y new ], thus [x]=[y new ] x = 11.54545454545455 11.18181818181818-19.63636363636364 21

Inverse is useful in solving sets of linear equations Not all square matrices have inverses! If A is a non-singular matrix A -1 A=AA -1 =I Set of linear equations Ax=y A -1 Ax=A -1 y x=a -1 y 22

Inverse of A is obtained by dividing the adjoint of A by the determinant of A: t A 1 ij 1 A A A Adj( A) Where A ij is the cofactor of an element a i,j in a square matrix: A ij =(-1) i+j [Determinant of (n-1) by (n-1) matrix not containing i th row and j th column: a a a A a a a A 11 12 13 21 12 13 21 22 23 21 ( 1) det a32 a33 a31 a32 a 33 Where Adj(A) is the adjoint of matrix A which is the transpose of the matrix formed by replacing each element in A by its cofactor t Adj( A) A ij a a 23

2 1 0 Find the inverse of a 1 3 1 using the adjoint of a: 0 2 1 a 1 Aij det( a) t 11 3 1 12 1 1 13 1 3 A11 ( 1) det 1, A12 ( 1) det 1, A13 ( 1) det 2 2 1 0 1 0 2 21 1 0 22 2 0 23 2 1 A21 ( 1) det 1, A22 ( 1) det 2, A13 ( 1) det 4 2 1 0 1 0 2 31 1 0 32 2 0 33 2 1 A31 ( 1) det 1, A12 ( 1) det 2, A13 ( 1) det 5 3 1 1 1 1 3 1 1 2 1 1 1 t { Aij} 1 2 4 =A Transpose of A is A 1 2 2, 1 2 5 2 4 5 determinant of a is det(a) (231) (11 0) (012) (030) ( 21 2) (111) 1 a 1 1 1 1 1 2 2 t 1 1 1 A ij 2 4 5 1 2 2 det( a) 1 2 4 5 24

x=a -1 y If A is a non-singular square matrix A -1 A=AA -1 =I Write an augmented matrix of the original matrix [A] and the identity matrix [I] Pivot Normalize with respect to the pivoting element Eliminate elements below and above the diagonal 25

a=[-2 4 1; 5 1 3; -6 7 0]; %Create an augmented matrix of a and I: A=[a, eye(3)]; A %Pivoting for the first row (exchanging the 1st and 3rd rows): tempo=a(1,:); A(1,:)=A(3,:); A(3,:)=tempo; %Normalizing the 1st row (Dividing by its pivot): A(1,:)=A(1,:)/A(1,1); %Eliminating the elements below the 1st diagonal: for i=2:3, A(i,:)=A(i,:)-A(i,1)*A(1,:); end, A %No more pivoting is required. Normalizing the second row: A(2,:)=A(2,:)/A(2,2); A %Eliminating the elements above and below the 2nd diagonal: for i=1:3, if i~=2, A(i,:)=A(i,:)-A(i,2)*A(2,:); end end, A %Normalizing the 3rd row: A(3,:)=A(3,:)/A(3,3); %Eliminating the elements above the 3rd diagonal for i=1:2, A(i,:)=A(i,:)-A(i,3)*A(3,:); end, A 26

A= -2 4 1 1 0 0 5 1 3 0 1 0-6 7 0 0 0 1.. Augmented matrix A A= 1.0000-1.1667 0 0 0-0.1667 0 6.8333 3.0000 0 1.0000 0.8333 0 1.6667 1.0000 1.0000 0-0.3333 A = 1.0000-1.1667 0 0 0-0.1667 0 1.0000 0.4390 0 0.1463 0.1220 0 1.6667 1.0000 1.0000 0-0.3333 Normalizing 1st row and 1st elimination Normalizing 2nd row 27

A = 1.0000 0 0.5122 0 0.1707-0.0244 0 1.0000 0.4390 0 0.1463 0.1220 0 0 0.2683 1.0000-0.2439-0.5366 A = 1.0000 0 0-1.9091 0.6364 1.0000 0 1.0000 0-1.6364 0.5455 1.0000 0 0 1.0000 3.7273-0.9091-2.0000 a -1 = -1.9091 0.6364 1.0000-1.6364 0.5455 1.0000 3.7273-0.9091-2.0000 2nd elimination Normalizing 3rd row and 3rd elimination 28

>> a_inv=[a(:,4) A(:,5) A(:,6)] >> y=[2;10;9]; %This is the y vector of the original problem >> x=a_inv*y a_inv = -1.9091 0.6364 1.0000-1.6364 0.5455 1.0000 3.7273-0.9091-2.0000 x = 11.5455 11.1818-19.6364 29

Gives the solution of a system of linear equations in terms of determinants Named after Gabriel Cramer (1704-1752), who published the rule in his 1750 Introduction à l'analyse des lignes courbes algébriques Inefficient for large matrices and thus not used in practical applications that involve many equations. No pivoting is needed, so more efficient than Gauss elimination for small matrices Ax=y where A i is the matrix formed by replacing the ith column of A by the column vector y 30

a x a x a x y 11 1 12 2 13 3 1 is a linear system of equations and can be written in matrix notation as a21x1 a22x2 a23x3 y2 a x = c : a11 a12 a13 x1 y1 a31x1 a32x2 a33x3 y3 a21 a22 a23 x2 y2 a31 a32 a 33 x 3 y 3 Replacing each column of a with y gives the following solutions for x : x 1 y1 a a det y2 a a y3 a a a a a det a a a a a a 12 13 22 23 32 33 11 12 13 21 22 23 31 32 33 x 2 a y a det a y a a y a a a a det a a a a a a 11 1 13 21 2 23 31 3 33 11 12 13 21 22 23 31 32 33 x 3 a11 a12 y det a21 a22 y a31 a32 y a a a det a a a a a a 1 2 3 11 12 13 21 22 23 31 32 33 31

Solve the following set of equations using 1. Matrix inversion 2. Gauss-Jordan relation 3. Cramer s rule x 1 + x 2 + 3 x 3 = 1 x 1 + 2 x 2 + 5 x 3 = 2 3 x 1 + x 2 + x 3 = 1 32

A x = y, where A = L U LUx=y Let Ux=z, then Lz=y A matrix may be decomposed to L (lower triangular matrix) and U (upper triangular matrix) using Gauss elimination Remember: The matrix after forward elimination is U Taking the inverse of L and U is easy and fast Inverse of L is a lower triangular matrix 33

A x = y, where A = L U LUx=y Let Ux=z, then Lz=y 1. Apply Gauss elimination to [A,I] together 2. Transform A U and I F (Gauss elimination) 3. FA=U and FI=F 4. F=L -1, so L=F -1 5. z=l -1 y, x=u -1 z In MATLAB [l,u,p]=lu(a) where PA=LU or [l,u]=lu(a) where l=p -1 L and u=u (P : Permutation matrix) 34

>> a=[-2 4 1 ; 5 1 3 ; -6 7 0 ]; >> [l,u,p]=lu(a) l = 1.0000 0 0-0.8333 1.0000 0 0.3333 0.2439 1.0000 u = -6.0000 7.0000 0 0 6.8333 3.0000 0 0 0.2683 p = 0 0 1 0 1 0 1 0 0 %gives the pivoted matrix a, %i.e. pa=lu >> l*u ans = -6 7 0 5 1 3-2 4 1 %gives the original matrix a, %i.e. A=p -1 lu >> p^(-1)*l*u ans = -2 4 1 5 1 3-6 7 0 >> z=(p^(-1)*l)\y z = 9.0000 17.5000-5.2683 >> x=u\z x = 11.5455 11.1818-19.6364 35

>> a=[-2 4 1 ; 5 1 3 ; -6 7 0 ]; >> [l,u]=lu(a) l = 0.3333 0.2439 1.0000-0.8333 1.0000 0 1.0000 0 0 u = -6.0000 7.0000 0 0 6.8333 3.0000 0 0 0.2683 % gives the original matrix a, % i.e. A=lu, where l=p -1 L >> l*u ans = -2 4 1 5 1 3-6 7 0 % gives the pivoted matrix a, % i.e. A=p -1 lu >> p^(-1)*l*u ans = -6 7 0 5 1 3-2 4 1 >> z=l\y z = 9.0000 17.5000-5.2683 >> x=u\z x = 11.5455 11.1818-19.6364 36

A=[3 pi sqrt(5) (3-5j)] Create row vector A containing elements specified A=1:100 Create row vector A starting with 1, counting by 1, ending at or before 100 A=100:-10:0 Create row vector A starting with 100, counting by -10 (decrementing), ending at or before 0 A=linspace(0,100,11) Create row vector A starting with 10, ending at 100, having 11 elements (ex: 0,10,20,30, 100) A=logspace(0,3,4) Create row vector A starting with 10^0, ending at 10^3, having 4 elements length(a) Returns the length of vector A d=size(m) [m,n]=size(m) For m-by-n matrix M, returns the two-element row vector For m-by-n matrix M, returns the number of rows and columns in M as separate output variables 37