3.10. Matrix and Array Operations

MATLAB supports two types of operations between arrays, known as array operations and matrix operations.

3.10.1. Arithmetic Operations on Matrices

Matrix operations follow the rules of linear algebra in MATLAB. It allows the following arithmetic operations to be carried out on matrices provided that the operands are compatible with the operator:

+addition
subtraction
*multiplication
/right division
^exponentiation
\left division

For example:

  • A+B is valid if A and B are matrices of the same size.

  • AB is valid if A and B are matrices of the same size.

  • A*B is valid if number of columns of A is equal to number of rows of B.

  • A/B is valid if A and B are of the same size and it is equal to AB−1 for same size square matrices ...

Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.