Chapter 4 Mathematical Operations with Arrays
MATLAB was designed with matrix manipulation in mind. As a result, performing mathematical operations on matrices is almost as easy as with scalars.
We shall see that there are two ways to perform mathematical operations with arrays: matrix operations (linear algebra) and element-by-element operations (these are operations performed on all elements of an array simultaneously).
Each method has its own set of operators (so that MATLAB knows which one it is you wish to use).
We’ll start by going over how to perform linear algebra operations in MATLAB and then turn to element-by-element operations.