Vector 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. For example,

$\displaystyle \mathbf{u} + \mathbf{v} =
\left[\begin{array}{c}
1 + 2 \\
-2 + ...
... 6
\end{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]
$

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

EXAMPLE 1. Given $ \mathbf{u} =
\left[\begin{array}{c}
1 \\
4
\end{array}\right]$ and $ \mathbf{v} =
\left[\begin{array}{c}
2 \\
-3
\end{array}\right]$, find $ 4 \mathbf{u}$, $ -3 \mathbf{v}$, and $ 4 \mathbf{u} -3 \mathbf{v}$.

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{arra...
...mathbf{u} = \left[\begin{array}{c}
a_1 \\
\vdots \\
a_n
\end{array}\right] \:$ in general.

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$.''



Subsections


Department of Mathematics
Last modified: 2005-10-21