rdivide

Element-wise right division, the function form of the ./ operator.

Category: Symbolic Computations in MATLAB > Operators and Elementary Operations

Syntax

C = rdivide(A, B)

Equivalent to A ./ B.

Description

rdivide(A, B) divides each element of A by the corresponding element of B. A scalar on either side is expanded to the size of the other argument, and compatible dimensions are expanded as with any element-wise operator.

With symbolic arguments the result stays exact: rdivide(x, y) is x/y, and a sym array divided by a number gives a sym array of fractions. Writing A ./ B calls this function.

Input arguments

A
Numerator: numeric, logical or symbolic array.
B
Denominator, of compatible size.

Output arguments

C
Array of element-wise quotients.

Example

Numeric and symbolic division

rdivide([6 8 10], [2 4 5])
syms x y
rdivide([x 2*x], 3)
rdivide(x, y)
Output
ans = 1×3

     3     2     2
ans = 
[x/3, (2*x)/3]
ans = x/y

See also

times mrdivide ldivide mtimes