Main Content

ldivide,.\

Element-wise quaternion left division

Syntax

Description

example

C=A.\Bperforms quaternion element-wise division by dividing each element of quaternionBby the corresponding element of quaternionA.

Examples

collapse all

Create a 2-by-1 quaternion array, and divide it element-by-element by a real scalar.

A = quaternion([1:4;5:8])
A =2x1 quaternion array1 + 2i + 3j + 4k 5 + 6i + 7j + 8k
B = 2; C = A.\B
C =2x1 quaternion array0.066667 - 0.13333i - 0.2j - 0.26667k 0.057471 - 0.068966i - 0.08046j - 0.091954k

Create a 2-by-2 quaternion array, and divide it element-by-element by another 2-by-2 quaternion array.

q1 = quaternion([1:4;2:5;4:7;5:8]); A = reshape(q1,2,2)
A =2x2 quaternion array1 + 2i + 3j + 4k 4 + 5i + 6j + 7k 2 + 3i + 4j + 5k 5 + 6i + 7j + 8k
q2 = quaternion(magic(4)); B = reshape(q2,2,2)
B =2x2 quaternion array16 + 2i + 3j + 13k 9 + 7i + 6j + 12k 5 + 11i + 10j + 8k 4 + 14i + 15j + 1k
C = A.\B
C =2x2 quaternion array2.7 - 1.9i - 0.9j - 1.7k 1.5159 - 0.37302i - 0.15079j - 0.02381k 2.2778 + 0.46296i - 0.57407j + 0.092593k 1.2471 + 0.91379i - 0.33908j - 0.1092k

Input Arguments

collapse all

Divisor, specified as a quaternion, an array of quaternions, a real scalar, or an array of real numbers.

AandBmust have compatible sizes. In the simplest cases, they can be the same size or one can be a scalar. Two inputs have compatible sizes if, for every dimension, the dimension sizes of the inputs are the same or one of the dimensions is 1.

Data Types:quaternion|single|double

Dividend, specified as a quaternion, an array of quaternions, a real scalar, or an array of real numbers.

AandBmust have compatible sizes. In the simplest cases, they can be the same size or one can be a scalar. Two inputs have compatible sizes if, for every dimension, the dimension sizes of the inputs are the same or one of the dimensions is 1.

Data Types:quaternion|single|double

Output Arguments

collapse all

Result of quaternion division, returned as a scalar, vector, matrix, or multidimensional array.

Data Types:quaternion

Algorithms

collapse all

四元数部门

Given a quaternion A = a 1 + a 2 i + a 3 j + a 4 k and a real scalarp,

C = p . \ A = a 1 p + a 2 p i + a 3 p j + a 4 p k

Note

For a real scalarp,A./p = A.\p.

四元数部门by a Quaternion Scalar

Given two quaternionsAandBof compatible sizes, then

C = A . \ B = A 1 . * B = ( c o n j ( A ) n o r m ( A ) 2 ) . * B

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

H版istory

Introduced in R2018b