Newpost

Matrix by vector multiplication matlab qerymatrix

The Matrix-Vector Product We now seek to introduce notation that will express the entire linear system (coefficients, variables and constants) using only matrices and vectors.. Matrix-vector product To define multiplication between a matrix A A and a vector x x (i.e., the matrix-vector product), we need to view the vector as a column matrix. We define the matrix-vector product only for the case when the number of columns in A A equals the number of rows in x x.

Das Matrix-Vektor-Produkt ist in der linearen Algebra das Produkt einer Matrix mit einem Spaltenvektor. Damit eine solche Matrix-Vektor-Multiplikation durchgeführt werden kann, muss die Spaltenzahl der Matrix mit der Zahl der Komponenten des Vektors übereinstimmen; das Ergebnis ist dann wieder ein Spaltenvektor, der genauso viele Komponenten wie die Matrix Zeilen hat. Seine Elemente ergeben sich durch komponentenweise Multiplikation und Summation der Einträge der entsprechenden Zeile der Matrix mit den Elementen des Ausgangsvektors:

(

a

11

a

12

a

1
n

a

21

a

22

a

2
n

a

m
1

a

m
2

a

m
n

)

(

v

1

v

2

v

n

)

=

(

a

11

v

1

+

a

12

v

2

+

+

a

1
n

v

n

a

21

v

1

+

a

22

v

2

+

+

a

2
n

v

n

a

m
1

v

1

+

a

m
2

v

2

+

+

a

2
m

v

n

)

{\displaystyle {\begin{pmatrix}a_{11}&a_{12}&\ldots &a_{1n}\\a_{21}&a_{22}&\ldots &a_{2n}\\\vdots &\vdots &&\vdots \\a_{m1}&a_{m2}&\ldots &a_{mn}\end{pmatrix}}\cdot {\begin{pmatrix}v_{1}\\v_{2}\\\vdots \\v_{n}\end{pmatrix}}={\begin{pmatrix}a_{11}v_{1}+a_{12}v_{2}+\cdots +a_{1n}v_{n}\\a_{21}v_{1}+a_{22}v_{2}+\cdots +a_{2n}v_{n}\\\vdots \\a_{m1}v_{1}+a_{m2}v_{2}+\cdots +a_{2m}v_{n}\end{pmatrix}}}

Das Matrix-Vektor-Produkt kann als Spezialfall einer Matrizenmultiplikation angesehen werden, bei der die zweite Matrix aus nur einer Spalte besteht. Umgekehrt lässt sich die Matrixmultiplikation als Verallgemeinerung des Matrix-Vektor-Produkts auffassen, bei der das Matrix-Vektor-Produkt für jede Spalte der Matrix ausgerechnet wird und die Ergebnisvektoren die Spalten der Ergebnismatrix bilden.

Das Matrix-Vektor-Produkt wird beispielsweise in der Matrixschreibweise linearer Gleichungssysteme sowie bei iterativen Verfahren zu ihrer numerischen Lösung eingesetzt. Weiter kann jede lineare Abbildung zwischen endlichdimensionalen Vektorräumen nach Wahl entsprechender Basen als Matrix-Vektor-Produkt dargestellt werden.

Definition

Ist

K

{\displaystyle K}

ein Körper (meist die reellen oder komplexen Zahlen), dann ist die Matrix-Vektor-Multiplikation eine Abbildung


 
:

K

m
×
n

×

K

n

K

m

,

(
A
,
x
)

y
=
A

x

{\displaystyle \cdot ~\colon K^{m\times n}\times K^{n}\to K^{m},\quad (A,x)\mapsto y=A\cdot x}

,

die einer Matrix

A
=
(

a

i
j

)

K

m
×
n

{\displaystyle A=(a_{ij})\in K^{m\times n}}

und einem Spaltenvektor

x
=
(

x

j

)

K

n

{\displaystyle x=(x_{j})\in K^{n}}

einen weiteren Spaltenvektor

y
=
(

y

i

)

K

m

{\displaystyle y=(y_{i})\in K^{m}}

zuordnet. Jedes Element

y

i

{\displaystyle y_{i}}

des Ergebnisvektors berechnet sich dabei über

y

i

=

j
=
1

n

a

i
j

x

j

{\displaystyle y_{i}=\sum _{j=1}^{n}a_{ij}\cdot x_{j}}

,

also als Standardskalarprodukt der

i

{\displaystyle i}

-ten Zeile von

A

{\displaystyle A}

mit dem Vektor

x

{\displaystyle x}

. Häufig wird bei der Notation eines Matrix-Vektor-Produkts der Malpunkt weggelassen und man schreibt kurz

A
x

{\displaystyle Ax}

statt

A

x

{\displaystyle A\cdot x}

.

Beispiel

Gegeben seien die reelle Matrix und der reelle Spaltenvektor

A
=

(

3

2

1

1

0

2

)

{\displaystyle A={\begin{pmatrix}3&2&1\\1&0&2\end{pmatrix}}}

  und  

x
=

(

1

0

4

)

{\displaystyle x={\begin{pmatrix}1\\0\\4\end{pmatrix}}}

.

Da die Matrix

A

{\displaystyle A}

ebenso viele Spalten besitzt wie der Vektor

x

{\displaystyle x}

Komponenten hat, ist das Matrix-Vektor-Produkt

A

x

{\displaystyle A\cdot x}

definiert, die betreffende Matrix-Vektor-Multiplikation also überhaupt durchführbar. Da

A

{\displaystyle A}

zwei Zeilen hat, wird der Ergebnisvektor

y

{\displaystyle y}

ebenfalls zwei Komponenten aufweisen. Um das erste Element des Ergebnisvektors zu berechnen, betrachtet man die erste Zeile von

A

{\displaystyle A}

, multipliziert die jeweils entsprechenden Einträge dieser Zeile komponentenweise mit denen des Ausgangsvektors und summiert die Ergebnisse auf (die Sternchen stehen für noch nicht berechnete Elemente):

(

3

2

1

1

0

2

)

(

1

0

4

)

=

(

3

1

+

2

0

+

1

4

)

=

(

7

)

{\displaystyle {\begin{pmatrix}\color {OliveGreen}3&\color {OliveGreen}2&\color {OliveGreen}1\\1&0&2\end{pmatrix}}\cdot {\begin{pmatrix}\color {BrickRed}1\\\color {BrickRed}0\\\color {BrickRed}4\end{pmatrix}}={\begin{pmatrix}{\color {OliveGreen}3}\cdot {\color {BrickRed}1}+{\color {OliveGreen}2}\cdot {\color {BrickRed}0}+{\color {OliveGreen}1}\cdot {\color {BrickRed}4}\\\ast \end{pmatrix}}={\begin{pmatrix}{\color {Blue}7}\\\ast \end{pmatrix}}}

.

Für das zweite Element des Ergebnisvektors betrachtet man entsprechend die zweite Zeile von

A

{\displaystyle A}

und berechnet analog:

(

3

2

1

1

0

2

)

(

1

0

4

)

=

(

7

1

1

+

0

0

+

2

4

)

=

(

7

9

)

{\displaystyle {\begin{pmatrix}3&2&1\\\color {OliveGreen}1&\color {OliveGreen}0&\color {OliveGreen}2\end{pmatrix}}\cdot {\begin{pmatrix}\color {BrickRed}1\\\color {BrickRed}0\\\color {BrickRed}4\end{pmatrix}}={\begin{pmatrix}7\\{\color {OliveGreen}1}\cdot {\color {BrickRed}1}+{\color {OliveGreen}0}\cdot {\color {BrickRed}0}+{\color {OliveGreen}2}\cdot {\color {BrickRed}4}\end{pmatrix}}={\begin{pmatrix}7\\{\color {Blue}9}\end{pmatrix}}}

.

Eigenschaften

Das Matrix-Vektor-Produkt ist assoziativ in dem Sinne, dass für Matrizen

A

K

l
×
m

{\displaystyle A\in K^{l\times m}}

,

B

K

m
×
n

{\displaystyle B\in K^{m\times n}}

und Vektoren

x

K

n

{\displaystyle x\in K^{n}}

A

(
B

x
)
=
(
A

B
)

x

{\displaystyle A\cdot (B\cdot x)=(A\cdot B)\cdot x}

gilt. Das Matrix-Vektor-Produkt ist auch verträglich mit der Multiplikation von Skalaren

a

K

{\displaystyle a\in K}

, das heißt

a

(
A

x
)
=
(
a

A
)

x
=
A

(
a

x
)

{\displaystyle a\,(A\cdot x)=(a\,A)\cdot x=A\cdot (a\,x)}

.

Betrachtet man die komponentenweise Matrizenaddition

A
+
B

{\displaystyle A+B}

zweier Matrizen

A
,
B

K

m
×
n

{\displaystyle A,B\in K^{m\times n}}

sowie die Vektoraddition zweier Vektoren

x
,
y

K

n

{\displaystyle x,y\in K^{n}}

, dann sind auch die Distributivgesetze erfüllt, das heißt, es gilt

(
A
+
B
)

x
=
A

x
+
B

x

{\displaystyle (A+B)\cdot x=A\cdot x+B\cdot x}

und

A

(
x
+
y
)
=
A

x
+
A

y

{\displaystyle A\cdot (x+y)=A\cdot x+A\cdot y}

.

Algorithmus

In Pseudocode kann das Matrix-Vektor-Produkt wie folgt implementiert werden:

Die Reihenfolge der beiden For-Schleifen kann dabei auch vertauscht werden. Da die beiden Schleifen unabhängig voneinander sind, ist die Anzahl der benötigten arithmetischen Operationen von der Ordnung

O
(
m

n
)

{\displaystyle O(m\cdot n)}

.

Die Laufzeit des Algorithmus ist für quadratische Matrizen

(
m
=
n
)

{\displaystyle (m=n)}

demnach von der Ordnung

O
(

n

2

)

{\displaystyle O(n^{2})}

. Spezielle Matrizen, wie Bandmatrizen, dünnbesetzte Matrizen oder Toeplitz-Matrizen, können durch Ausnutzen der Struktur auch effizienter mit einem Vektor multipliziert werden.

Verwendung

Das Matrix-Vektor-Produkt wird in der linearen Algebra häufig verwendet. So ist die Matrixschreibweise eines linearen Gleichungssystems

A

x
=
b

{\displaystyle A\cdot x=b}

nichts anderes als eine Vektorgleichung, auf deren linken Seite ein Matrix-Vektor-Produkt steht. Viele iterative Verfahren zur numerischen Lösung linearer Gleichungssysteme, wie das Verfahren der konjugierten Gradienten oder allgemeine Krylow-Unterraum-Verfahren, basieren auf wiederholten Matrix-Vektor-Multiplikationen. Auch die Potenzmethode zur Ermittlung des betragsgrößten Eigenwerts einer Matrix basiert auf der wiederholten Berechnung von Matrix-Vektor-Produkten.

Sind allgemein

V

{\displaystyle V}

und

W

{\displaystyle W}

zwei endlichdimensionale Vektorräume über dem gleichen Körper, dann kann jede lineare Abbildung

f
:
V

W

{\displaystyle f\colon V\to W}

nach Wahl je einer Basis in beiden Vektorräumen über ihre Abbildungsmatrix

M

f

{\displaystyle M_{f}}

dargestellt werden. Das Bild

y

{\displaystyle y}

eines Vektors

x

{\displaystyle x}

unter der Abbildung

f

{\displaystyle f}

in den jeweiligen Basen kann dann über das Matrix-Vektor-Produkt

y
=

M

f


x

{\displaystyle y=M_{f}\cdot x}

ermittelt werden. In der Geometrie lässt sich beispielsweise auf diese Weise jede Drehung um den Ursprung und jede Spiegelung an einer Ursprungsebene durch ein solches Matrix-Vektor-Produkt ausführen, ebenso jede Axonometrie in geeigneten Koordinaten. Auch diskrete Faltungen, beispielsweise die diskrete Fourier-Transformation, können als Matrix-Vektor-Produkt realisiert werden.

In den Wirtschaftswissenschaften wird das Matrix-Vektor-Produkt bei der Input-Output-Analyse benutzt.

Literatur

  • Gene Golub, Charles van Loan: Matrix Computations. JHU Press, 2012, ISBN 978-1-4214-0794-4. 
  • Charles Leiserson, Ronald L. Rivest, Clifford Stein: Algorithmen – eine Einführung. Oldenbourg, 2010, ISBN 978-3-486-59002-9. 

Einzelnachweise


Math and Dynamics Vector Cross Product

Math and Dynamics Vector Cross Product as MatrixVector Multiplication


DefinitionVector ConceptsTransforming a Vector Using Matrix

DefinitionVector ConceptsTransforming a Vector Using Matrix


PPT Parallele Programmierung und Parallele Algorithmen

PPT Parallele Programmierung und Parallele Algorithmen Matrix


Multiply matrix by vector matlab polffamily

Multiply matrix by vector matlab polffamily


PPT Transformations PowerPoint Presentation, free download

PPT Transformations PowerPoint Presentation, free download ID5559409


PPT Foundations of Computer Graphics (Fall

PPT Foundations of Computer Graphics (Fall 2012 ) PowerPoint


Linear algebra's most important operations 1️⃣

Linear algebra’s most important operations 1️⃣ Vectorvector


Matrix by vector multiplication matlab nicmens

Matrix by vector multiplication matlab nicmens


Matrix Vector Multiplication YouTube

Matrix Vector Multiplication YouTube


PPT Economics 2301 PowerPoint Presentation, free

PPT Economics 2301 PowerPoint Presentation, free download ID5751190


PPT Formal Computational Skills PowerPoint Presentation,

PPT Formal Computational Skills PowerPoint Presentation, free


PPT ENGG2013 Unit 5 Linear Combination

PPT ENGG2013 Unit 5 Linear Combination & Linear Independence


Vector Matrix at Collection of Vector

Vector Matrix at Collection of Vector Matrix free for


Matrixvector and Matrixmatrix Multiplication YouTube

Matrixvector and Matrixmatrix Multiplication YouTube


Prof. Thomas Sterling Department of Computer

Prof. Thomas Sterling Department of Computer Science ppt download


Vektoren miteinander multiplizieren

Vektoren miteinander multiplizieren


ScalarVector Multiplication Digital System Design

ScalarVector Multiplication Digital System Design


M1 22.1 MatrixVektorMultiplikation YouTube

M1 22.1 MatrixVektorMultiplikation YouTube


Linear algebra's most important operations 1️⃣

Linear algebra’s most important operations 1️⃣ Vectorvector


What Is A Vector Matrix Matrices

What Is A Vector Matrix Matrices And Vectors Math For AI With Python

2.2 Matrix-Vector Multiplication Up to now we have used matrices to solve systems of linear equations by manipulating the rows of the augmented matrix. In this section we introduce a different way of describing linear systems that makes more use of the coefficient matrix of the system and leads to a useful way of “multiplying” matrices.. The physical meaning of multiplying a matrix by a vector, and how it works on several special matrices.