Arithmetic Operators

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

775420-2-4R2 AID: 232624 |

01/01/2023

In MATLAB, an arithmetic statement is a command that performs some operation on one


or more numeric values (such as scalars, vectors, or matrices) and produces a result.

For example, the following are all examples of arithmetic statements in MATLAB:

y = 3 + 5
z = x * y
a = b / c
d = a ^ 2

In each of these examples, an arithmetic operation is being performed on one or more


values, and the result is being assigned to a variable.

Arithmetic Operators

In MATLAB, the following symbols are used as arithmetic operators:

1. +: Add
2. -: Subtract
3. *: Multiply
4. /: Divide
5. \: Left matrix division (also known as "mldivide" or "backslash")
6. .\: Element-wise left matrix division
7. ./: Element-wise right matrix division
8. .^: Element-wise exponentiation
9. ^: Exponentiation (matrix power)

These operators can be used in arithmetic statements to carry out a broad range of
mathematical operations, including fundamental calculations, algebraic operations, and
more complex computations.

You might also like