Arithmetic Operators in MATLAB
摘要
In this chapter, the reference functions concerned with the arithmetic operators in MATLAB are presented and described. MATLAB includes two types of arithmetic operations including matrix and array operations. Matrix operations are defined by the rules of linear algebra, while array operations are carried out element-by-element. The period character “.” is used for array operations to distinguish them from the matrix operations. In this regard, several examples and exercises for each section of the chapter are presented. The exercises that include writing the codes, executing them, and achieving the results need to be done by students to master programming skills. In this book, the codes, outputs, and descriptions are in blue, black, and green colors, respectively. To program in MATLAB, a script file can be created and saved with an appropriate name (e.g., untitled01) in the preferred directory of a computer. The program can be run by clicking on the “Run” available on the top toolbar of the script in MATLAB or calling the script by typing its name in Command Window or in the other scripts.