5/20/2019
Right-matrix division - MATLAB mrdivide /
mrdivide, / Right-matrix division
Syntax X = A/b X = mrdivide(A, b)
Description X = A/b performs right-matrix division.
example
X = mrdivide(A, b) is an alternative way to execute X = A/b.
Examples
collapse all
Divide fi Matrix by a Constant
In this example, you use the forward slash (/) operator to perform right matrix division on a 3-by-3 magic square of fi objects. Because the numerator input is a fi object, the denominator input b must be a scalar.
Try it in MATLAB
A = fi(magic(3)) A = 8 3 4
1 5 9
6 7 2
DataTypeMode: Signedness: WordLength: FractionLength:
Fixed-point: binary point scaling Signed 16 11
b = fi(3,1,12,8) b = 3 DataTypeMode: Signedness: WordLength: FractionLength:
Fixed-point: binary point scaling Signed 12 8
X = A/b X = 2.6250 1.0000 1.3750
0.3750 1.6250 3.0000
2.0000 2.3750 0.6250
DataTypeMode: Fixed-point: binary point scaling https://www.mathworks.com/help/fixedpoint/ref/embedded.fi.mrdivide.html
1/3
5/20/2019
Right-matrix division - MATLAB mrdivide /
Signedness: Signed WordLength: 16 FractionLength: 3
Perform Matrix Division
You can perform right-matrix division when neither input is a fi object. The matrix dimensions must be compatible for matrix division.
Try it in MATLAB
A = [2, 3, 1; 0, 8, 4; 1, 1, 0] A = 3×3 2 0 1
3 8 1
1 4 0
B = [7, 6, 6; 1, 0, 5; 9, 0, 4] B = 3×3 7 1 9
6 0 0
6 5 4
X = mrdivide(A,B) X = 3×3 0.5000 1.3333 0.1667
-0.2927 0.0325 -0.2033
-0.1341 -1.0407 0.0041
Input Arguments
collapse all
A — Numerator scalar | vector | matrix | multidimensional array
Numerator, specified as a scalar, vector, matrix, or multidimensional array. If one or both of the inputs is a fi object, then b must be a scalar. When b is a scalar, mrdivide is equivalent to rdivide. Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | fi Complex Number : Yes
b — Denominator scalar | vector | matrix | multidimensional array
https://www.mathworks.com/help/fixedpoint/ref/embedded.fi.mrdivide.html
2/3
5/20/2019
Right-matrix division - MATLAB mrdivide /
Denominator, specified as a real scalar, vector, matrix, or multidimensional array. If one or both of the inputs is a fi object, then b must be a scalar. When b is a scalar, mrdivide is equivalent to rdivide. If neither input is a fi object, then the sizes of the input matrices must be compatible for matrix division. Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | fi
Output Arguments
collapse all
X — Quotient scalar | vector | matrix | multidimensional array
Solution, returned as an array with the same dimensions as the numerator input A. When A is complex, the real and imaginary parts of A are independently divided by b.
Extended Capabilities C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
See Also add | divide | fi | fimath | numerictype | rdivide | sub | sum
Introduced in R2009a
https://www.mathworks.com/help/fixedpoint/ref/embedded.fi.mrdivide.html
3/3