Matrix operations in MATLAB.pdf

Attribution Non-Commercial (BY-NC)

131 views

Matrix operations in MATLAB.pdf

Attribution Non-Commercial (BY-NC)

- MT Chapter 03
- Matrix_(mathematics).pdf
- CT5123_LectureNotesThe Finite Element Method an Introduction
- matlab
- Lab-01
- MATH286_NotesS1P1 2 Matlab 2
- 1112 QMDS100 Fall1 Outline
- Solve Matrices in Excel
- Pre-calculus / math notes (unit 15 of 22)
- Pallin Drome
- IntroMatlab
- Bai-Tap-buoi-1-B.pdf
- Mathematical Overview CFD
- Chapter 1
- LADE22 Applications of Systems
- Matrik_2_Pwt
- Algebra 2 Final Exam Review.doc
- l_5
- Jeopardy Review
- MATLAB Basic Commands

You are on page 1of 5

With MATLAB it is possible to perform operations and commands on matrices. For this, MATLAB knows a lot of commands. A number of these operations will be/have been treated in the course Linear Algebra. At this moment, the following MATLAB operations are of importance.

Multiplication

The multiplication of two matrices is performed in a special manner. For a matrix , where , we define the product of and to be the matrix matrix and a

So,

The product of the matrices en can only be formed if the sizes of and are compatible: the number of columns of has to be equal to the number of rows of . If exists, does not need to exist. If as well as exists, we generally do not have that . Within MATLAB, the matrix product of and is always defined if either or is a number. Multiplication of a matrix by a number (scalar multiplication) boils down to multiplication of all matrix elements by that number. The symbol for matrix multiplication in MATLAB is * , i.e.,

> >A * B

Addition

www.imc.tue.nl/IMC-main/imc-main-node38.html

1/5

9/17/13

> >A + B

and subtraction:

> >A B

of two matrices and is performed by addition and subtraction of the separate elements of the matrix. In MATLAB, these operations are defined if the sizes of the matrices are the same or if one of the matrices is a scalar. In the latter case the scalar is added to or subtracted from every element of the matrix.

Raising to a power

The command

> >A ^ p

to the

power. If

is a positive integer,

of by itself. The matrix needs to be square (i.e., the number of rows is equal to the number of columns) in order to be able to perform this operation.

Transposition

Let be an with matrix. Then the transpose of . So: , denoted by , is the matrix

(4.2)

In MATLAB, the command t r a n s p o s e ( A )or A '(the latter only for real valued matrices) calculates the transpose of the matrix . To give an example:

> >[ 123 ] '

> >1 2 3

www.imc.tue.nl/IMC-main/imc-main-node38.html

2/5

9/17/13

If the matrix contains complex, non-real, elements, then the command A 'does not only reflect the matrix with respect to the diagonal, but it also takes the complex conjugate of every element. If you only want to calculate the reflection of with respect to the diagonal, you can do this with the command A . ' . We illustrate this by means of two examples.

> >A=[ 2 + 3 * i4 + 5 * i 2 3 ] A= 2 . 0 0 0 0 + 3 . 0 0 0 0 i4 . 0 0 0 0 + 5 . 0 0 0 0 i 2 . 0 0 0 0 3 . 0 0 0 0 > >A ' a n s= 2 . 0 0 0 0 3 . 0 0 0 0 i 4 . 0 0 0 0 5 . 0 0 0 0 i > >A . ' a n s= 2 . 0 0 0 0 + 3 . 0 0 0 0 i 4 . 0 0 0 0 + 5 . 0 0 0 0 i

2 . 0 0 0 0 3 . 0 0 0 0

2 . 0 0 0 0 3 . 0 0 0 0

You need to take this into account when dealing with symbolic matrix elements (or you have to define your symbolic elements as reals).

> >s y m sab > >A=[ ab 12 ] A= a ,b 1 ,2 > >A ' a n s= [c o n j ( a ) , [c o n j ( b ) , > >A . ' a n s= [a ,1 ] [b ,2 ]

1 ] 2 ]

No division

A division operator is not defined for matrices. However, sometimes one needs to find a matrix such that for given matrices and , where and are of appropriate dimensions. This is discussed in Section 4.4.

www.imc.tue.nl/IMC-main/imc-main-node38.html 3/5

9/17/13

In this paragraph we mention some commands that have a matrix as their argument. The command:

> >i n v ( A )

if

such that

If no inverse exists, MATLAB will give a warning the matrix is singular. Possibly, it will present a matrix, with Inf as elements, e.g.

> >i n v ( [ 11 ; 00 ] ) W a r n i n g :M a t r i xi ss i n g u l a rt ow o r k i n gp r e c i s i o n . a n s= I n f I n f

I n f I n f

Sometimes, an inverse with finite elements is found by MATLAB, which may be inaccurate. In that case, MATLAB will present the following warning:

> >i n v ( [ 1 e 80 ; 01 e 8 ] ) W a r n i n g :M a t r i xi sc l o s et os i n g u l a ro rb a d l ys c a l e d . R e s u l t sm a yb ei n a c c u r a t e .R C O N D=1 . 0 0 0 0 0 0 e 0 1 6 . a n s= 1 . 0 e + 0 0 8* 1 . 0 0 0 0 0 0 0 . 0 0 0 0

The command:

> >d e t ( A )

> >r a n k ( A )

> >e i g ( A )

gives a vector containing the eigenvalues of the matrix often used in the form

www.imc.tue.nl/IMC-main/imc-main-node38.html

. The matrix

4/5

9/17/13

This results in matrices and , so that . Every column of is an eigenvector of , while is a diagonal matrix with diagonal elements equal to the eigenvalues of associated with the eigenvectors in the corresponding columns of . Remark: The commands above can also be used for symbolic matrices. However, you have to be aware of the fact that there are other matrix functions that cannot be used for symbolic matrices. Furthermore, there are also commands that can only be used for symbolic matrices.

Previous

Next

Up

Contents

Esteur 2010-03-22

www.imc.tue.nl/IMC-main/imc-main-node38.html

5/5

- MT Chapter 03Uploaded byCornelz Lius
- Matrix_(mathematics).pdfUploaded byTeka Kam
- CT5123_LectureNotesThe Finite Element Method an IntroductionUploaded byXristoforos Kolomvos
- matlabUploaded byAvinash Choudhary
- Lab-01Uploaded byJacob Daniells
- MATH286_NotesS1P1 2 Matlab 2Uploaded bykirubha_karan2000
- 1112 QMDS100 Fall1 OutlineUploaded byJacky Tang
- Solve Matrices in ExcelUploaded byTint Tiger
- Pre-calculus / math notes (unit 15 of 22)Uploaded byOmegaUser
- Pallin DromeUploaded byAE06 Avionics
- IntroMatlabUploaded byBurak Boyacıoqlu
- Bai-Tap-buoi-1-B.pdfUploaded byDang Cong San
- Mathematical Overview CFDUploaded bykoszio
- Chapter 1Uploaded byAlifNR
- LADE22 Applications of SystemsUploaded byRoumen Guha
- Matrik_2_PwtUploaded byDamy Manesi
- Algebra 2 Final Exam Review.docUploaded byMark Abion Valladolid
- l_5Uploaded byEntropyPrinciple
- Jeopardy ReviewUploaded byBarbara_Amador_2011
- MATLAB Basic CommandsUploaded byViren Gulati
- MATRIX MULTIPLICATION MODULE (MATRIX STYLE)Uploaded byequinigan
- NTU102S207_CS01L02Uploaded byHerol
- Modeling TransformationsUploaded byImran Hayder
- bs lab.docUploaded byVenky Venkatesh
- community resources mathematicsUploaded byapi-342085664
- 9231_w12_qp_13Uploaded byChristopher Barrett
- Clase de Ingeniería de Control Con MatlabUploaded byEber Gómez Sandoval
- 223Uploaded bynarendra
- What is a Principal Component AnalysingUploaded bysouvik5000
- execution-portfoliosUploaded bypostscript

- ContSys1 L5 SDOF RespAllUploaded byUmer Abbas
- ppt on API 650Uploaded byferdad
- 1-s2.0-S0196890413007383-mainUploaded byUmer Abbas
- 1-s2.0-S096014811200081X-mainUploaded byUmer Abbas
- ContSys1 L6 SDOF ControlUploaded byUmer Abbas
- 1-s2.0-S0038092X01000962-mainUploaded byUmer Abbas
- 1-s2.0-0038092X91900622-mainUploaded byUmer Abbas
- Enhancing the Performance of PV Panels by Water CoolingUploaded byUmer Abbas
- Thermal Performance of Hybrid PVT Collector With Natural CirculationUploaded byUmer Abbas
- Thermal Modeling of a Combined System of Photovoltaic Thermal PVT Solar Water HeaterUploaded byUmer Abbas
- Thermal Model of Solar Swimming PoolsUploaded byUmer Abbas
- Energy and Exergy Analysis of Hybrid Photovoltaic Thermal Water Collector for Constant Collection Temperature ModeUploaded byUmer Abbas
- Efficient Single Glazed Flat Plate Photovoltaic–Thermal Hybrid Collector for Domestic Hot Water SystemUploaded byUmer Abbas
- Effect of Packing Factor on the Performance of PVT Water HeaterUploaded byUmer Abbas
- Detailed Analysis of the Energy Yield of Systems With Covered Sheet-And-tube PVT CollectorsUploaded byUmer Abbas
- Transient Analysis of a Photovoltaic-Thermal Solar Collector for Co-generation of Electricity and Hot Air-waterUploaded byUmer Abbas
- The Yield of Different Combined PV-Thermal Collector DesignsUploaded byUmer Abbas
- The Interaction of Standards and Innovation HybridUploaded byUmer Abbas
- Simulation and Model Validation of Sheet and Tube Type Photovoltaic Thermal Solar System and Conventional Solar Collecting System in Transient StatesUploaded byUmer Abbas
- Performance Evaluation of Concentrating Solar PhotovoltaicUploaded byUmer Abbas
- Performance Analysis of Photovoltaic Thermal Air HeatersUploaded byUmer Abbas
- Performance Analysis of a Double-pass Photovoltaic-Thermal PVT Solar Collector With CPC and FinsUploaded byUmer Abbas
- Pitch Versus Stall ~ Wind EnergyUploaded byUmer Abbas
- ContSys1 L4 FOS AllUploaded byUmer Abbas
- ContSys1 L3 Laplace TransUploaded byUmer Abbas
- ContSys1 L2 Block DiagUploaded byUmer Abbas
- ContSys1 L1 Intro(1)Uploaded byUmer Abbas

- A Stabilized Conforming Nodal Integration for Galerkin Meshfree MethodUploaded bySANTATRI87
- Cheb Yshev PolynomialsUploaded byRaciel Ammz
- Coll Alg ExamUploaded byschmitfamily
- MATLAB DocumentationUploaded byGandhi Hammoud
- banach separation thrm.pdfUploaded byYogesh Rana
- 416 - pr 19-1 - some useful expressions for boson-operators - Bruus, FlensbergUploaded byBradley Nartowt
- Tensor Notation (Basics)Uploaded byyadavame
- NCERT Math 12 Part1Uploaded byPrakash Patil
- Radicals and Artinian RingsUploaded byngocbichbl
- No Tesla PlaceUploaded byAjit Panja
- Vector Dot Product WSUploaded byDavid Reese
- ArrayUploaded byAmar Rajput
- Convex and concave functionsUploaded byrnmukerjee
- Lecture 17Uploaded bySeban Augustine
- (Quadratic Equations 2Uploaded byRohit Singh
- Bicomplex NumberUploaded byJohan Papado
- On solution of sylvester equation.pdfUploaded byAzhar Mahmood
- Ling521 - Homework 3 FftUploaded bycejavier
- HomeworkODEUploaded byStefanos van Dijk
- Inequality Messi Red3Uploaded byVanHieu1997
- TensorUploaded bySebastiao Silva
- Работен Лист 2 За Транслација, Ротација Рефлексија (1)Uploaded byTanjaIvanovskaHristovska
- Teorema Liou VilleUploaded bycaralleo
- 9780387401225-c3Uploaded byJoshua
- ANother Lecture NotesUploaded byLeilani Manalaysay
- Chapter 4.4 Inverse Circular Functions.pdfUploaded byjii
- Numerical Analysis LaboratoryUploaded byBappa Saha
- lesson-1SUploaded byAtiqah Osman
- CK12_Calculus.pdfUploaded byG
- ADDMATH FORM 4Uploaded byNor Hanina