ABSTRACT

In the previous chapter we learned how to store a set of numbers under one name and how to operate on them by using that name. We introduced thus the notion of a one-dimensional array. In this chapter we are going to generalize this notion and its uses. First we show that we can store numbers not only as one line, but also as a column. Next we combine one-dimensional arrays into two-dimensional arrays. The array is the basic data structure of MATLAB. We show that the one-dimensional array allows a natural representation of vectors, quantities that have a magnitude, a direction and a sense. The operations defined on vectors are the addition, the multiplication by a scalar, the scalar, or dot product and the vector, or cross product. This chapter includes a few applications of vectors in Geometry and in Mechanics.