e-Mathematics > Matrix Algebra [Admin]

Vector Operations

Vectors and Their Operations. A matrix with only one column is called a column vector, or simply a vector. For example, $ \mathbf{u} =
\left[\begin{array}{c}
1 \\
-2 \\
-5
\end{array}\right]$ and $ \mathbf{v} =
\left[\begin{array}{c}
2 \\
5 \\
6
\end{array}\right]$ are vectors. Then we can define the addition “ $ \mathbf{u} + \mathbf{v}$” of two vectors, and the multiplications “ $ c \mathbf{u}$” of a vector with a real number $ c$, in which $ c$ is called a scalar. In the above example,

$\displaystyle \mathbf{u} + \mathbf{v} =
\left[\begin{array}{c}
1 + 2 \\
-2...
...d{array}\right]
=
\left[\begin{array}{c}
3 \\
3 \\
1
\end{array}\right]$    and $\displaystyle \quad
c \mathbf{u} =
\left[\begin{array}{c}
c \times (1) \\
c \times (-2) \\
c \times (-5)
\end{array}\right]
$

EXAMPLE 1. (This demonstration requires arrow.m to draw vectors as in the plot below.) Given $ \mathbf{u} =
\left[\begin{array}{c}
1 \\
1
\end{array}\right]$ and $ \mathbf{v} =
\left[\begin{array}{c}
-1 \\
2
\end{array}\right]$, find $ 2 \mathbf{u} + \mathbf{v}$ and $ \mathbf{u} -2 \mathbf{v}$.

Image figure01

n-Dimensional Vectors. The following vectors $ \mathbf{a}$ and $ \mathbf{b}$ are called a 2-dimensional and 3-dimensional vector, respectively.

$\displaystyle \mathbf{a} = \left[\begin{array}{c}
3 \\
-1
\end{array}\right]$    and $\displaystyle \quad
\mathbf{b} = \left[\begin{array}{c}
2 \\
3 \\
4
\end...
...bf{u} = \left[\begin{array}{c}
a_1 \\
\vdots \\
a_n
\end{array}\right] \:$ in general. $\displaystyle $

A vector  $ \mathbf{u}$ with $ n$ real numbers is called an n-dimensional vector. We often call it simply “a vector in $ \mathbb{R}^n$.”

Matlab/Octave. In Matlab/Octave we can set a new vector in either of the following forms:

> u = [1; -2; -5]

> u = [1 -2 -5]'
If you type only “u = [1 -2 -5]”, it gives a “row” instead of a “column.” Then the apostrophe (') must be attached, which does a transposition. You can add a vector and multiply it by a scalar as follows:
> u + v

> 5 * u


© TTU Mathematics