.\
Element-wise left division operator.
Category: Language Fundamentals > Operators and Elementary Operations
Syntax
C = A .\ B
Divides each element of B by the matching element of A. Same as ldivide(A, B), or B ./ A.
Description
The backslash points toward the operand that is divided: the quantity on the right is divided by the one on the left. It is the same operation as ./ with the operands swapped, and it is rarely needed. Division by zero follows IEEE rules and yields Inf or NaN.
Do not confuse it with \, the matrix left division that solves linear systems.
Input arguments
A- Denominator: numeric or logical array.
B- Numerator, with a size compatible with
A.
Output arguments
C- Array of quotients
B ./ A.
Example
[1 2 4] .\ [2 4 8]
2 .\ [1 2 3]
Output
ans = 1×3
2 2 2
ans = 1×3
0.5000 1.0000 1.5000