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]$](img45.png)
![$ \mathbf{v} =
\left[\begin{array}{c}
2 \\
5 \\
6
\end{array}\right]$](img46.png)




![$\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]$](img50.png)
![$\displaystyle \quad
c \mathbf{u} =
\left[\begin{array}{c}
c \times (1) \\
c \times (-2) \\
c \times (-5)
\end{array}\right]
$](img51.png)
EXAMPLE 1.
(This demonstration requires
arrow.m
to draw vectors as in the plot below.)
Given
and
,
find
and
.

n-Dimensional Vectors.
The following vectors
and
are called a 2-dimensional and 3-dimensional vector, respectively.
![$\displaystyle \mathbf{a} = \left[\begin{array}{c}
3 \\
-1
\end{array}\right]$](img58.png)
![$\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] \:$](img59.png)




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