<<

This article was downloaded by: 10.3.98.104 On: 26 Sep 2021 Access details: subscription number Publisher: CRC Press Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: 5 Howick Place, London SW1P 1WG, UK

MATLAB Handbook with Applications to , Science, , and Finance

José Miguel, David Báez-López, David Alfredo Báez Villegas

Matrices and

Publication details https://www.routledgehandbooks.com/doi/10.1201/9781315228457-4 José Miguel, David Báez-López, David Alfredo Báez Villegas Published online on: 15 Jan 2019

How to cite :- José Miguel, David Báez-López, David Alfredo Báez Villegas. 15 Jan 2019, Matrices and Linear Algebra from: MATLAB Handbook with Applications to Mathematics, Science, Engineering, and Finance CRC Press Accessed on: 26 Sep 2021 https://www.routledgehandbooks.com/doi/10.1201/9781315228457-4

PLEASE SCROLL DOWN FOR DOCUMENT

Full terms and conditions of use: https://www.routledgehandbooks.com/legal-notices/terms

This Document PDF may be used for research, teaching and private study purposes. Any substantial or systematic reproductions, re-distribution, re-selling, loan or sub-licensing, systematic supply or distribution in any form to anyone is expressly forbidden.

The publisher does not give any warranty express or implied or make any representation that the contents will be complete or accurate or up to date. The publisher shall not be liable for an loss, actions, claims, proceedings, demand or costs or damages whatsoever or howsoever caused arising directly or indirectly in connection with or arising out of the use of this material. Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 nacutn,i h rs ui,i nhoooy hmsr n ilg,to biology, finance, and in chemistry , anthropology, in in engineering, few. music, in a arts, applications mention the of in , deal mathematics accounting, great the in in a only in not matrices also of but applications find to possible is them. it with works to MATLAB attention which special in deserves way it the Thus, learn MATLAB. of to name reduced the was received subsequently and matrices, with operations As Introduction 4.1 Matrices 4.2 4 Algebra Linear and Matrices 4 Chapter .2Cnldn Remarks Concluding Structures 4.12 Arrays Cell 4.11 4.10 negneigsc si piiaino ytm,atmtccnrl oden- food control, automatic ar- systems, of are optimization problems many in coefficients in as appear equations’ such systems engineering equations the in Simultaneous . because a equations in ranged simultaneous of tems Products Cross and Dot 4.6 Matrices with Operations Basic 4.3 . ievle n Eigenvectors and Eigenvalues 4.9 . Vectors Polynomial Characteristic The 4.5 4.4 . ytm fSmlaeu ierEquations Linear Simultaneous of Systems 4.8 . arxadVco Functions Vector and Matrix 4.7 1Introduction .1 nte motn plcto fmtie sgvni h ouino sys- of solution the in given is matrices of application important Another manner, this In knowledge. of areas the all in found practically are Matrices etoe nCatr1 ALBwsoiial eindt ar out carry to designed originally was MATLAB 1, Chapter in mentioned .. o Dot 4.6.1 Generation Vector Vector a of 4.5.2 4.5.1 Operator Dot The 4.3.1 .. UFactorization LU 4.8.1 .. rs Product Cross 4.6.2 ...... Matrix Lab rtr that oratory 113 112 114 103 105 105 104 110 109 106 107 106 91 92 91 99 98 98 96 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 oinpcue,te eaeadn nte ieso otedfiiinof or The called matrices. definition images are multidimensional matrix the television about the to of a talking form case dimension are that in we the another objects ordered thus is adding are The and as are matrices matrices matrix. we time, two such a then with These is for changes pictures, matrix. numbers any is image of a motion matrix or table an form a objects, a If also be example, letters, image . to For an numbers, array. satisfy of ordered of should pixels an array matrix be a an to that be it condition can only matrix The a thing. way, this In matrix a of concept as: the defines algebra consider linear functions to of predefined convenient book the then any in that is are It they or MATLAB. user-defined inside are they whether session, M Matrices 4.2 used are terms Both array. an as matrix a to refer also we indistinctly. matrix, a of tion matrix several problems. present of 14 solution to the 9 in Chapters applications etc. engineering, chemical gineering, 92 n o Ufcoiaino arx h hpe nswt el rasand arrays cells with ends chapter The matrix. vec- systems, a and equations of matrix simultaneous structures. factorization solve to LU to to dedicated presented for how is is and and section section vectors A A with functions. continues products. tor It name. vector them. a and by with dot practical identified performed compute is more be element can and each that numbers. efficient but tions and more cell a things a to in or similar data people is handle of structure to A names way. us as allow such arrays combinations types These handle can variable they different that is of difference fundamental car- fast. the manner but and this matrices, efficient In very indexing. becomes of arrays means using by calculations arrays out handle rying to potential the the has in later described already be and will previously editor given array matrix This chapter. a variable. of MATLAB elements a the as modify stored to or matrix a of TA ade nmti omaltevralsdfie naMATLAB a in defined variables the all form matrix in handles ATLAB neapeo arxis matrix a of example An elements the introduce to users allows that editor array an defini- has this MATLAB From entities). (or numbers of array an as defined is matrix A h hpe eiswt ecito fmtie n h ai opera- basic the and matrices of description a with begins chapter The also are arrays Cell arrays. structure and cell covers chapter the Finally, MATLAB vectors, and matrices with operations basic the to Additionally arxi naryo ubr robjects. or numbers of array an is Matrix A M ATLAB

R ADOKwt Applications with HANDBOOK elements ftematrix. the of Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 otenme fclms hti,if is, dimension that of columns, matrix of number the to semicolon. a can with (they separated space i, are a rows by the row and same comma) Matrix a the with of separated elements also the be separated have we is, That matrix the MATLAB, In matrix. the of dimension the called is ie bv.W rt gi arxAi the in A matrix again write We above. given nFgr . hr ehv lodslydthe displayed also have matrix see we we where window 4.2 Figure in A ensteeeeto row of element the defines command The 2. 3, position matrix in matrix that say We has columns. matrix 3 a and rows 4 has which h numbers The rdltd ecnee d e lmnst matrix 4.2. to Figure elements modified to in new either row shown be add fifth can a even as now add MATLAB can which values We to element deleted. attached the or see window clearly new can we a There as open will pcfida 4 a as specified j ALBhsa ra dtr oilsrt t s ecnie ma consider we use its illustrate To editor. array an has MATLAB hc orsod oispsto nthe in position its to corresponds which AL 4.1: TABLE A arxcommand Matrix ssoni iue41 aheeetfo h matrix the from element Each 4.1. Figure in shown is A A h lmn a h oiin2 hl h lmn a the has 7 element the while 1 2, position the has 8 element the c:d A( n i 30;8- 495] 5 9 -4 ; 5 7 2 ; 4 -6 8 ; 0 -3 1 [ = a:b, osand rows and :, A( :) A( × k, h lmnsta r on ob de are added be to going are that elements The A. ra.I edul lc nti cnthe icon this on click double we If array. 3 j j) te omnsaegvni al 4.1. Table in given are commands Other n. r aldteidcso h ( the of indices the called are A arcsadLna Algebra Linear and Matrices n nthe in and m ) arxcommands Matrix oun,i sa is it columns, i A n column and 0-7 10 5 = t column. th the in elements j- the by formed row. Vector th the in elements k- the by formed Vector columns and rows of consisting Submatrix Description     A( − Workspace 1 8 5 7 2 5 9 4 ,j) i, m = n − − 0 3 4 6 n ftenme frw sequal is rows of number the If j. × esyta matrix that say we c omn Window Command i     eseteio o h variable the for icon the see we t m th o Workspace arx h quantity The matrix. d. o n nthe in and row i, A lmn.Frexample, For element. j) so ieso 4 dimension of is nti xml we example this In A. idw nthis In window. a A hsi shown is This . A ra Editor Array t a position a has o A sdfie by defined is j b sasquare a is th column. n × trix × .If 3. 9 m A 3 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 94 IUE42 ALBaryeio window. editor array MATLAB 4.2: FIGURE M IUE41 ALBmi window. main MATLAB 4.1: FIGURE ATLAB

R ADOKwt Applications with HANDBOOK Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 h ra dtri hnoe hwn h lmnso h aibeselected. variable the of elements the showing open then is editor array The open to way Another 4.3. Figure writing in by shown is the as editor displayed in array If be the added. will elements matrix the the 4.3 A, Figure in see We oeseilmtie r hw nTbe4.2. Table in shown are matrices special Some >> T BE4.2: ABLE y(,n) eye(m, eye(n) zeros(n) n) zeros(m, ones(n) n) ones(m, name Matrix pnname_of_the_matrix open IUE43 ALBadaryeio ihnwelements. new with editor array and MATLAB 4.3: FIGURE arcsadLna Algebra Linear and Matrices pca matrices Special ignl h eann lmnsaezeros. are elements remaining The diagonal. of order Matrix of matrix identity Square value. zero has order of value. matrix zero Square having element every with Matrix value. unity has order of matrix Square value. unity has of Matrix Description m× m× n n d d mninwt ’ ntemain the in 1’s with imension element each where imension n n w w Command eeec element each here element each here n Window ewrite we 9 5 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 n iiin h diinadsbrcino w arcscnb are out carried size be same can the matrices are two matrices of both subtraction if and addition The division. and Matrices with T Operations Basic 4.3 96 ieso s3 is dimension Matrix of ftefis arxi qa otenme frw ftescn arx nour In matrix. second the for of performed rows of be number can the columns product to of the equal number the is matrices, if matrix out first carried the be of can matrices two of The C ebscoeain ihmtie r diin utato,multiplication, subtraction, addition, are matrices with operations basic he eas hyhv h aesz 3 size same the have they because B foeo h arcsi clr hti,i samti fdmnin1 dimension of matrix a is it is, that , a is matrices the of one If >> >> >> >> and A A*B = D A = D n = ans n = ans = ans C C + A C, a ieso 3 dimension has − − B 23 -6 -2 -3 2-9 4 12 15 C 11 5 12 51 1-1 -1 0-0-6 -50 10 A and 1 1 -3 6 2 3 A -5 3 5-0-3 -20 -5 × = .Fradto rsbrcin tcnol edn for done be only can it subtraction, or addition For 2. M   eso h eutof result the show We A. ATLAB 5 7 9 1 − − 6 3 ×   ,matrix 2,

R , ADOKwt Applications with HANDBOOK B = n  1 6 3 4 × × B .Then: 2. o xml for example For m. ieso s2 is dimension − 0 2 A*B A  and , C B, = × C   n o matrix for and 3 5 6 2 and A, − − − swl sthat as well as B, B 3 1 2   and C ie by given A C and × the 1, Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 fasur matrix square a of where the addition, scalar. of the element case by each multiplication, multiplied the For is in matrix. matrix the case, of the this element of each In to done. added be is scalar also can computations the A of result The A\B. o oeso arcs hr xs w osblte.If possibilities. two matrix exist the there matrices, of powers For 45-;- ;01-1] 7] 1 8 0 2; 9 -6; 3 5 -6 -7; 4 3; 5 that have we [4 2 = B [1 = A inv( oe.Sm xmlsilsrt hsfor this illustrate examples Some power. o h iiino qaemtie w osblte xs,namely exist, possibilities two matrices square of division the For >> matrix square a of inverse The >> >> >> >> A)* I o h arcsAadBgvnby given B and A matrices the For B. inv(A) p∧ A∧ B\A A/B steiett arx(the matrix identity the is n = ans = ans n = ans = ans 685 .50-105.6250 9.7500 16.8750 A p A .50050 -5.2500 0.5000 1.7500 226 -3.4833 -28.1250 -2.2667 2.7500 4.3750 4101 55 44 24 .33376 -4.3000 3.7667 1.7333 .33036 -0.9500 0.3167 0.9333 otescalar the to A A/B sotie with obtained is arcsadLna Algebra Linear and Matrices stesm as same the is nteohrhand other the On p. AM A eye(n) = samatrix a is MA A*inv = 2 = p arxi ALB.Teinverse The MATLAB). in matrix I ( while B) p∧ M 4.4500 uhthat such A ie h scalar the gives p sascalar a is A\B stesm as same the is A∧ A/B p p othe to gives and 9 7 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 te prtoswt arcsaegvni al 4.3. Table in given are matrices with operations Other hr h lmnsof elements the where exponentiation: for and of elements the where division: For of elements the where multiplication: For by: given sfre ypaigadtbfr h prtr h prtosfrmatrices for operations The operator. the operator before complete dot The a term-by-term. A obtain placing are to by and operations formed divide, multiply, The is to arrays. useful of is operator powers This dimension. the called same is the It matrices. and arrays with operator to operator another Operator is There Dot The 4.3.1 98 fasur matrix square a of instruction The polynomial. Polynomial F Characteristic The 4.4 reeysur arxw soit oyoilcle h characteristic the called polynomial a associate we matrix square every or and B ftesm ieso rdc e matrix new a produce dimension same the of n trfr ooeain emt-embtentomtie of matrices two between term-to-term operations to refers it and .121.8738 1.0202 0.8162 0.4455 * 1.0e+003 M A ATLAB hc sdfie as defined is which C C C r ie by: given are by: given are by: given are

R c poly ij ADOKwt Applications with HANDBOOK c c = ij ij A. = C A./B = C A.*B = C rdcstecaatrsi polynomial characteristic the produces a = = ij ∧ a a $textttb ij ij ∧ /b *b B ij ij ij C hs lmnsare elements whose p( dot x) Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 A oun aldclm etr etr bymti ue.A neape the example, an As rules. matrix obey Vectors vector. column called column, A Vectors 4.5 w hc en httecaatrsi oyoilo h qaematrix square the of polynomial characteristic the that means which here - AL 4.3: TABLE etri arxwt igerwcle o etr rwt single a with or vector, row called row single a with matrix a is vector >> >> o xml,frtemti ie by given A matrix the for example, For xI. arxoperation Matrix rnps (A) I = A n = ans 123 ;91 1] 11 10 9 7; 6 5 3; 2 [1 = A poly(A) steiett arxand matrix identity the is rc (A) trace ig(A) diag poly(A) (A) (A) det omA norm A.∧ n A inv 011 7 3 10 6 2 9 5 1 .00-800 2.000.0000 -24.0000 -18.0000 1.0000 A./B A.*B A∧ A/B A’ A\B c c arxoperations Matrix arcsadLna Algebra Linear and Matrices ()=x = p(x) id h hrceitcplnma of polynomial characteristic the Finds division. Term-to-term product. the Term-to-term o as Same as Same of element Each of Matrix diagonal main the of of Norm elements the of Sum of Rank of of Transpose of Transpose diagonal. main the of of Inverse elements the with Vector Description ()=dtA-xI) - det(A = p(x) det A 3 A. inv(A)*B A*inv(B) A. t − A. acltstedtriato h matrix the of determinant the calculates 8x 18 A. A. A c A 2 th ( . . t − if the o power. 24 A sasur matrix). square a is x c th power. A. A A. is 9 9 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 h index The j oeoeain ihvcosaegvni al ..I hstbew aethat have we table this In 4.4. Table in given a are vectors with operations Some and to the from display etrw s neig o example For indexing. different. use completely we are Nevertheless, vector them polynomials. on for out 3 carried are Chapter that of operations definition the the to according does, 10. dimension of vector column a is while 4, dimension of vector row a is by: given vector row 100 fvectors If are dot a by nt.Then, units. and >> >> >> fw nydsr odslyo the on display to desire polynomial only a we as If MATLAB in structure same the has vector a that Note (:j k) j: y(i: b n = ans = ans ( 3:3) : -3 : y(9 10) : 3 : y(2 y(2:4) are n = ans a j -5 11 -7 18 -5 18 and dmninlvcosand vectors n-dimensional 2 3 6 a eas eaie o example: For negative. also be can term-to-term b 8;- 7;2;4;3;1 7] 17 ; 11 ; 3 ; 4 ; 2 ; -7 ; 6 ; -5 ; 18 ; 9 [ = y ie h lmnsfo the from elements the gives M n h scalar the and k ATLAB th othe to

prtos enwpeetsm examples. some present now We operations. R m ADOKwt Applications with HANDBOOK th 13- 4] -7 3 [1 = x c lmns o example For elements. r ie by given are (:m) y(k: c omn Window Command sasaa.Teoeain preceded operations The scalar. a is i th pcfista eol ihto wish only we that specifies othe to k th oeeeet fa of elements some u eaae by separated but , Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 n ue.I hswy ti osbet utpytovcosi h rtoei a is of one vector first column a the multiply if to vectors wish two we multiply if to or rows, possible with is multiplication matrix vector it observe way, row we if this possible In only is rules. vectors two of product The hn ecnpromtefloigoperations: following the perform can we Then, oun.Freape fw aetevectors the have we if example, For columns. >> >> >> >> >> >> 3 ,1] 1 7, -3, [ = a n = ans = ans n = ans = ans = ans a*c c + a a.\b a.*b a.∧ 3 ,1] 1 7, -3, [ = a 61 2 14 -6 066 0.5714 -0.6667 b 193 9 -1 62 3 28 -6 1 2401 9 AL 4.4: TABLE Operation m b + a c + a a.∧ a.∧ a.\b a./b a.*b c. a*c oun n h eodoei ounvco with vector column a is one second the and columns ∧ arcsadLna Algebra Linear and Matrices , a b c , b [ [ [ [ [ [ [ [ [ Result ,4 ] 3 4, 2, [ = a c∧ a b a a a a a etroperations Vector ,4 ] 3 4, 2, [ = b 1 1 1 1 1 1 1 1 ∧ /a /b *c, +c, a ∧ ∗ + c 1 3.0000 b 1 1 b , b 1 , , , a 1 1 c∧ a , a , b a 2 , 2 2 a a 2 2 *c, a +c, ∧ a 2 2 /a /b 2 2 c, ∧ ∗ , + 2 2 , . . . b , , , . . . b , . . . , . . . 2 b 2 , ...... , , 2 , , . . . c∧ a a a a , . . . , . . . n b n n n *c n a , a ∧ +c /b n /a 2 = c n n c a a ] n ] ∗ osb o etrof vector row a by rows n n n ] ] b ] ∧ ] + 2 = c n b b ] n n ] ] 1 01 m Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 ta s h ubro oun of columns of number the is, with: (that it do we element each to 2 subtract clr a lob oe nti a,i ehv vector a have we if way, this In done. di- be the also because can error scalars it. an allow indicate not do will vectors perform the we of that mensions operation other Any Then multiply can ewl eal opromol h olwn operations: following the only perform to able be will We 102 fw aeamatrix a have involve we that If operations basic the matrices, of case the to way similar a In >> >> >> >> >> >> >> >> >> >> 30]; 5]; 20; 4; [10; 3; = 2; z]; u [1; y = x s [w c]; = b r [a = t A*b n = ans 3- ;491;2- ;62-5]; 2 6 9; -4 2 17; 9 4 A*b 0; -2 [3 = A n = ans n = ans u*t t*u 30]; 5]; 20; 4; [10; 3; = 2; z]; u [1; y = x s [w = r 3 ;-7]; 2; [3; = b ysabcwxyz c]; y b x [a w = c t b a syms -65 -89 is 5 0a 0b 30*c] 30*b, 30*a, 20*c] [ 20*b, 20*a, 10*c] [ 10*b, 10*a, [ 30*c + 20*b + 10*a If A*b. M ATLAB A A and = % A     % fdimension of o vector. Row b 2 17 6 9 2 4 3

R are o vector. Row % ADOKwt Applications with HANDBOOK − − ounvector. Column 9 4 0 2 % % A − ounvector. Column hsi h o product. dot the is This seult h ubro osof rows of number the to equal is 5     n× , v m 2. - b n vector a and =   − 2 3 7   b v fdimension of n ews to wish we and we b) m, Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 o h ulda norm Euclidean the For h ulda omi h etrmgiuegvnby given magnitude vector the is norm Euclidean The n o the for And vector ]’ the for -2 Thus, 4 components. vector’s 3 the [ of magnitude greatest the The The vector. a of length the of generalization a an is of vector a Vector of a norm The of Norm 4.5.1 u fteaslt auso h etrcmoet.Ta is: the That for is components. value 1-norm vector the default The of 2-norm. The values called vector. absolute also the a norm of of sum Euclidean norm the the to MATLAB corresponding in obtain to use: We >> >> >> >> nr,as aldCeyhvnr rtemxmmnr sgvnby given is norm maximum the or norm Chebyshev called also ∞-norm, dmninlvco sdfie by defined is vector n-dimensional n = ans n = ans = ans om ,1) x, norm( norm(x) 2) norm(x, om ,p) x, norm( 9 5.3852 5.3852 57 ∞-norm fw iht n h 1-norm: the find to wish we if , |x arcsadLna Algebra Linear and Matrices ||x | ||x omx 2) norm(x, ||x = || || || p ||x 1 2 (x = = || = 2 |x q = 1 p 1 | .. x + q + 1 2 rsimply or x .. x + |x 2 p 1 2 x 2 + + | 2 2 + ... x + 2 2 ... + . + + x + norm(x) . n p |x x ) + 1/p n 2 n | x n 2 p-norm p s2, is = x 1 03 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 nevl[ interval where use can we vector similar a create To of vector a and generates instruction This in function function a a evaluate evaluate to to desired generate is we it that if one example, For the interval. is given vector a of type special A Generation Vector 4.5.2 104 h nevl For interval. the hr h rtpiti 10 is point first the where use we vector spaced logarithmic a create To from different be can value final the example, increment, For the b. of value the on Depending increment + a >> >> >> >> o example, For b. a = x = ans = x = x isae1 0 10) 10, linspace(1, = x Inf) norm(x, osae2 ,4) 5, logspace(2, = x . 6 : 0.7 : 3 = x steiiilpitadtefloigpit are: points following the and point initial the is a, 10 9 8 7 6 5 4 3 2 1 4 0 00100100000 10000 1000 100 .00370 .00510 5.8000 5.1000 4.4000 3.7000 3.0000 .I h itnebtencneuiepit slna,w a use: can we linear, is points consecutive between distance the If b]. a M 2, = , ATLAB 2*increment + a osae(a,b,n) n , b , a ( logspace = x b isae ,b ) n b, a, linspace( = x nrmn b; : increment : a = x ∧ and 5 = h atpiti 10∧ is point last the a,

R ADOKwt Applications with HANDBOOK n ehave we 4 = ,..., n lmnseulysae between spaced equally elements k*increment + a b n hr are there and ,.., b n f( onsin points nan in x) a Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 h o rdc ftovcosi locle h clrpoutadinner vectors and For product scalar. scalar a the is called result also product is dot vectors two The of product. product dot The Product Dot vector. a 4.6.1 is one product cross the and scalar a is result uct Products Cross T and Dot 4.6 rdc sgvnby: given is product o h rvosydfie etr ehave we vectors defined previously the For vector. column second the by it multiply we then and is, vector That row a it make with: found be also can product dot The vectors For with: product dot the finds MATLAB etr r rhgnl hti,teagebtenvectors between have the we is, and that orthogonal, are vectors where eeaetoipratpout novn etr.Te r the are They vectors. involving products important two are here >> to vector first the transpose we if evaluated be also can product dot The >> >> >> >> n the and θ a’*b ]; 4 ; ]; b) 7 1 , ; ; (a -8 -2 dot ; ; = 3 3 c [ ; = 2 b [ = a ) b , a ( dot n = ans = c steagebtenbt etr.W a edl e hti the if that see readily can We vectors. both between angle the is -28 -28 a rs product cross cos(90 and b x y) (x, ◦ ie eo,w have we below, given ,adtedtpouti qa ozero. to equal is product dot the and 0, = ) arcsadLna Algebra Linear and Matrices = b) (a, lokonas known also = x 1 *y 1 a’*b +x |a |bcos ∗ | 2 *y etrproduct vector 2 . + ... + (θ ) x n *y n a x h o product dot The . and and b o prod- dot h dot the y, is θ 90 = 1 05 ◦ Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 hc orsod ovector to corresponds which hc saohrvco hs opnnsaetesn fec opnn of component each of sine the are components vector whose the vector another is which by given ] vector -7 row the 3 consider Window diagonal matrix 2 us evaluate a to [ let and is MATLAB, it = matrix in easy how modal functions show To vector a one. and involving quasidiagonal a form transform possibly eigenvec- to required or and required one, the eigenvalues is into This of eigenvectors. evaluation matrix generalized the the cases requires some in is it functions and since matrix tors, task Evaluating result. easy the calculations an produce necessary not to the makes user) MATLAB the matrix, to a (transparent of function a evaluate to Functions Vector and I Matrix 4.7 vectors For product cross the finds MATLAB vectors. with three-dimensional vectors for by evaluated formed be plane the to thogonal product cross The Product Cross 4.6.2 106 spsil oeaut ucin fmtie n etr.We erequest we When vectors. and matrices of functions evaluate to possible is t >> >> ucin endi ALB swl sue endoe,cnb used be can ones, defined user as well as MATLAB, in defined Functions >> >> >> >> = y : rs(1 b1) cross(a1, 1=[-7;1 2] 12 ; 11 ; -27 [ = b1 7] -7 sin(x) 3 = 2 y [ = x ] 23 ; 6 ; 9 [ = a1 b) cross(a, n = ans x. -729 -181 .03011 -0.6570 0.1411 0.9093 a 261 and ofidtefunction the find To . M b a ATLAB ie eo,w n h rs rdc with product cross the find we below, given × locle etrpout saohrvco or- vector another is product, vector called also b,

R 11 79 261] -729, -181, [ ; ADOKwt Applications with HANDBOOK ; sin(x) a and esml rt nthe in write simply we h rs rdc a only can product cross The b. . Command x Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 . ytm fSmlaeu ierEquations Linear Simultaneous F of Systems 4.8 by given is n if And function any for Thus, matrices. and vectors with oyoildfie by defined polynomial where oigwy(oetedul qa ): equal double the instruction (note the way with lowing symbolically, them, solve can MATLAB then where rasto iutnoslna qain uhas such equations linear simultaneous of set a or >> >> >> >> x = x = ans v v x ]=sle ax+by= ,dx+ey= ,x y]) ],[x, f == e*y + d*x c, == b*y y + x [a*x f solve( e = d y] c [x, b a syms ]; 9 -4 ; 5 D∧ [2 = D a easaa,avco,o arx If matrix. a or vector, a scalar, a be can savco,then: vector, a is a eete o etro ounoe o xml,fra for example, For one. column a or vector row a either be can (bf-ce)(* b*d) - )/(a*e c*e - b*f -( 2*D + 3 35405 -375 507 -281 f(A) ∧ ()=[f(v [ = f(v) * 17 + 7*D - 2 p(x) arcsadLna Algebra Linear and Matrices = =      f(a f(a f(a x ∧ . . . a 11 n1 21 d 2 + 3 D x ) ) ) x 1 = ) b + e + f(a f(a f(a  ∗ f(v 9 4 5 2 x y y 12 n2 22 ∧ 2 c = ) ) f = ) )  2 − ...... 7 ∗ D f( x f(a f(a f(a f(v samti ie by given matrix a is 17 + if x), nn 2n 1n n) ) ) ) ]      A samatrix, a is solve ntefol- the in f(A) 1 07 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 o xml,frtesse feutosgvnby: given equations of system the for example, For matrix the by of given inverse is the taking by solution solved be can it above, given set the for Thus, form. with matrix in system the write instruction The 108 osleti ytmo qain,w rteaut h nes of inverse the evaluate first we equations, of system this solve To h aersl a eotie yteinstruction the by obtained be can result same The by it multiply we e fsmlaeu qain a lob ovdt ieanumerical a give to solved be also can equations simultaneous of set A >> >> >> >> >> >> >> >> = y isleA v) linsolve(A, y = f]; e]; x x [c; d f = b; e v [a d = c A b a syms A\b = x 0] -2 0 -2;0 6 -2 0;0 0]; -2 inv(A)*b 0; 6 = 0; 0;-2 x [5; 0 = -2 b [2 = A = x = x = x af-cd/ae-b*d) - c*d)/(a*e - (a*f -1.2500 af-cd/ae-b*d)] - c*d)/(a*e b*d)] - - (a*f f*b)/(a*e [ + -(-e*c [ 1.2500 3.7500 1.2500 3.7500 linsolve 0 M b: ATLAB A =     − ovstesm e feutos u ehv to have we but equations, of set same the solves 2 0 0 0

R 6 2 ADOKwt Applications with HANDBOOK inv(A)*b = x − − 0 0 2 2 6 2 − − 0 2 0 2     hn h etro unknowns of vector the Then, A. , b =     0 0 0 5     ; A n then and Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 rdc falwrtinua matrix triangular lower a of product LU Factorization LU 4.8.1 result. same the gives which LU write can we is, hnteslto is solution the then b, o h matrix the For is format tion atrzto a epromdwt h instruction the with performed be can factorization fmatrix If U\( = x >> >> >> atrzto losu owieasur o-iglrmatrix non-singular square a write to us allows factorization = U = L = A L ]=lu(A) = U] [L, 1234 ;91 11;- 69] -6 4 -3 12; 11 10 9 8; 7 6 5 4; 3 2 [1 = A (A) lu = U] , L [ -1.2500 L\b) .001.001.0012.0000 11.0000 10.0000 9.0000 033 .0000 0 1.0000 -0.3333 34- 9 -6 4 -3 A .00000 0 0 1.0000 0.5000 0.0606 1.0000 0.5556 8 7 6 5 .11011 .000 1.0000 0.1212 0.1111 01 12 4 11 3 10 9 2 1 A stemti fasse flna qain nteform the in equations linear of system a of matrix the is A 0 0 0 1.0909 2.0606 0 0 13.0000 -2.3333 0 7.3333 0 0 ie by given as arcsadLna Algebra Linear and Matrices U L = A L n nuprtinua matrix triangular upper an and lu(A) n h instruc- the and A that U, sthe as x= Ax 1 09 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 n h eut are: results the and with found be can eigenvalues and eigenvectors Then, matrix consider us let example, an As eigenvalues. the are of vectors h instruction The ievle a eete elo ope ubr.T n ievcosand eigenvectors find To instruction numbers. the complex use or we real eigenvalues either be can Eigenvalues vector words, other In constant a multiply we when is, That matrix square a for that vectors dimension unique are Eigenvectors eigenvalues. and Eigenvectors A and Eigenvalues 4.9 If 110 eyiprattpci arxagbacnen h a ofideigenvectors find to way the concerns algebra matrix in topic important very 1;2 1 ] 6 -1; 2; ; [1 = b >> >> >> = V = x 4010 ;- ;4012] 1 0 4 0; eig(A) 2 = 0 D] -1 [V, 0; 3 2 2 0; 1 0 [4 = A U = x Matrix A. n λ . 028 -0.2887 -0.2887 0 1.0 -3.6029 -5.2984 n vector a and 1.9074 6.9938 aldthe called .870.2887 0.2887 0 0 1.0e+15* eig \(Lb) M D ATLAB eun w arcs Matrix matrices. two returns sadaoa arxwoeeeet ftemi diagonal main the of elements whose matrix diagonal a is x eigenvalue nycagsmgiuebtkestesm direction. same the keeps but magnitude changes only x A hnfrtematrix the for then

fsize of R by V ]=eig(A) = D] [V, ADOKwt Applications with HANDBOOK x eoti h aevco u utpidby multiplied but vector same the obtain we x= Ax aif h olwn equation: following the satisfy n, of A λ orsodn othe to corresponding x A ie bv ehave we above given V a sclmsteeigen- the columns as has A ie by given eigenvector A of x. Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 n h lmnsi uedaoa r qa o1 esyta matrix that say We 1. to equal are eigenvalues superdiagonal the are in diagonal elements main the the in and elements The matrix. diagonal almost hs eseta h ievle are: eigenvalues the that see we Thus, odncnnclfr.Freape o matrix for example, For form. canonical Jordan where eigenvectors generalized find to find procedure to The is is 2. MATLAB then reference using procedure see eigenvectors, generalized The can on independent. treatment readers detailed linearly a For eigenvectors. be generalized to matrix eigenvectors the all of columns the are eigenvectors corresponding the and ecnseta ntesprignlw ae1sol bv h eigenvalues the above only 1’s have unity. we than superdiagonal greater the multiplicity in with that see can We oemtie apnt aerpae ievle n ecno find cannot we and eigenvalues repeated have to happen matrices Some >> >> V = D = V = A = D samti hs oun r h eeaie ievcosand eigenvectors generalized the are columns whose matrix a is V ]=jordan(A) = D] 1] [V, 0 0 0 0; 2 0 0 0; -1 2 0 1; 1 2 [2 = A 100 .00-.001.0000 -1.0000 1.0000 -1.0000 1 0 0 0 2 0 0 0 0 -1 1 2 1 0 2 2 2 0 0 1 0 2 0 0 0 1 2 0 0 0 0 1 .00000 0 0 1.0000 . .600.8660 -0.2887 0.8660 -0.2887 1.0 0 0 0 3 0 0 0 3 0 0 0 0 0 0 2 0 0 0 2 -0.5000 0 -0.2500 0.5000 0 0 0 0 arcsadLna Algebra Linear and Matrices V ]=jra (A) jordan = J] [V, λ 1 2, = λ A 2 ie above given 2, = λ 3 ,and 3, = V. λ J 4 J san is 3, = sin is 1 11 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 nomto skona elidxn.W a e elb typing: by cell enter a to see manner can This We braces. indexing. with cell data as the known enclosed is we information case this in that Note write simply we array cell the to Addressing. student Content second called a is add arrays To address to technique This is: stored store information us The array. let way: cell used, following are the and elements in created matrix called column number, be array a that can cell assigned way a array be same in cell students the a about in how information identified show be To can identified. cell Each cell. C Arrays Cell 4.10 112 l rasaemtie hr ecnsoevralso ieettp neach in type different of variables store can we where matrices are arrays ell tdn(,6 {2013}; = 9.6]}; 6) {[10 7.8]}; Student(2, = 10 5) {[10 Student(2, = 2012’}; 4) {‘Fall Student(2, = 3) {19890510}; Student(2, = Michele’}; 2) {‘Laura Student(2, = 1) Student(2, ]; 2012; 8.9 ]; = 9.9 8 6} [ 9.8 Student{1, = 10 5} [ Student{1, = 2012’; 4} ‘Fall Student{1, = 3} 19941027; Student{1, = Cervantes’; 2} ‘Ophelia Student{1, = 1} Student{1, tdn{,:} Student{2, Semester M , ATLAB Homework IUE44 elarray. Cell 4.4: FIGURE

R grades, ADOKwt Applications with HANDBOOK Exam grades, Student Year hsi oei the in done is This . ahsuetwill student Each . Name , ID Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 fw nyws oseaseicfil eol rt tdn n h field the and Student write only we field specific a see to wish only we If in: as there, stored fw rt hsvral nthe in variable this write we If nti tutr eaedfiigsxfilsadec edi aigreference variable making the is under field grouped each are fields and these fields All six subject. defining different a are to we structure this In a in stored consider us be Let can name. information a This is, way: section. that following previous field, the the a in by of structure identified arrays is cell cell the each case this in S Structures 4.11 ooti iue4.4. Figure obtain to with elements array the “see” can We rcue r rasta a losoedffrn ye fifrain but information, of types different store also can that arrays are tructures >> tdn.xm . . ]; 2012; 8.9 ]; = 9.9 8 Student.Graduation [ 9.8 = 10 Student.Exams [ = 2012’; Student.Homework ‘Fall = Student.Semester 19941027; = Baez’; Student.ID ‘Gary = Student.Name cellplot(Student) n = ans = ans = ans = ans = ans = ans Student al2019 Fall Michele Laura 2013 9.6000 10.0000 7.8000 10.0000 10.0000 19891005 arcsadLna Algebra Linear and Matrices omn Window Command eoti h information the obtain we Student 1 13 . Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 odncnnclmtie.Fnly h oiso elary n tutrsare structures and arrays as unique cell well are of as topics eigenvalues operators described. the and and Finally, eigenvectors matrices. operations covered canonical these we Jordan of addition, that Many In operations MATLAB. them. the to with vectors, and work matrices can with we started We MATLAB. in have I Remarks Concluding 4.12 is element second the and variable The write: we student second a add To in as data, previous the to data new the concatenate we exam third a add To we if Thus, matrices. of case the in as proceed the we change data to add wish to or change To field the for data the see to wish we if example For dot. Semester a by separated name 114 ecnadnwa aysuet sw edb olwn h aeprocedure. same the following by need we as students many as now add can We in as hscatrw aecvrdtemi seto h ieetary ecan we arrays different the of aspect main the covered have we chapter this n >> >> >> >> tdn()Gauto 2013; = 9.6]; Student(2).Graduation [10 7.8]; = 10 Student(2).Exams [10 = 2012’; Student(2).Homework ‘Fall = Student(2).Semester 19890510; = Student(2).ID tdn()Nm LuaMichele’ ‘Laura = Student(2).Name ]; 9.7 [Student.Exams, = Student.Exams ]; 9.8 9.9 10 [ = Student.Homework Student.Semester ewrite we Student M Homework ATLAB o a w lmns h rteeetis element first The elements. two has now Student(2)

R aat 09998 hnw nywrite only we then 9.8, 9.9 10 to data ADOKwt Applications with HANDBOOK ecnaddt otenew the to data add can We . Student(1) Student