Main Content

ldivide,.\

Symbolic array left division

Description

example

B.\AdividesAbyB.

ldivide(B,A)is equivalent toB.\A.

Examples

Divide Scalar by Matrix

Create a2-by-3matrix.

B = sym('b', [2 3])
B = [ b1_1, b1_2, b1_3] [ b2_1, b2_2, b2_3]

Divide the symbolic expressionsin(a)by each element of the matrixB.

syms a B.\sin(a)
ans = [ sin(a)/b1_1, sin(a)/b1_2, sin(a)/b1_3] [ sin(a)/b2_1, sin(a)/b2_2, sin(a)/b2_3]

Divide Matrix by Matrix

Create a3-by-3symbolic Hilbert matrix and a3-by-3diagonal matrix.

H = sym(hilb(3)) d = diag(sym([1 2 3]))
H = [ 1, 1/2, 1/3] [ 1/2, 1/3, 1/4] [ 1/3, 1/4, 1/5] d = [ 1, 0, 0] [ 0, 2, 0] [ 0, 0, 3]

DividedbyHby using the elementwise left division operator.\. This operator divides each element of the first matrix by the corresponding element of the second matrix. The dimensions of the matrices must be the same.

H.\d
ans = [ 1, 0, 0] [ 0, 6, 0] [ 0, 0, 15]

表达除以符号函数

Divide a symbolic expression by a symbolic function. The result is a symbolic function.

syms f(x) f(x) = x^2; f1 = f.\(x^2 + 5*x + 6)
f1(x) = (x^2 + 5*x + 6)/x^2

Input Arguments

艾尔崩溃l

Input, specified as a symbolic scalar variable, matrix variable(since R2021a), function, expression, or vector, matrix, or array of symbolic scalar variables. InputsAandBmust be the same size unless one is a scalar. A scalar value expands into an array of the same size as the other input.

Input, specified as a symbolic scalar variable, matrix variable(since R2021a), function, expression, or vector, matrix, or array of symbolic scalar variables. InputsAandBmust be the same size unless one is a scalar. A scalar value expands into an array of the same size as the other input.

Introduced before R2006a