Main Content

mldivide, \

Quaternion left division for scalars

Since R2024a

    Syntax

    Description

    C = A\B performs left division between a scalar and a quaternion or array of quaternions.

    example

    Examples

    collapse all

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

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

    Create a 2-by-2 quaternion array, and left divide it by a quaternion scalar.

    q1 = quaternion(magic(4));
    A = reshape(q1,2,2)
    A = 2×2 quaternion array
         16 +  2i +  3j + 13k      9 +  7i +  6j + 12k
          5 + 11i + 10j +  8k      4 + 14i + 15j +  1k
    
    B = quaternion([1:4])
    B = quaternion
         1 + 2i + 3j + 4k
    
    C = A\B
    C = 2×2 quaternion array
           0.18493 +   0.13014i +  0.061644j +   0.11644k        0.2871 +  0.074194i +  0.080645j +  0.048387k
            0.2871 -  0.054839i +   0.10645j - 0.0032258k       0.18493 -   0.14384i +   0.11644j + 0.0068493k
    

    Input Arguments

    collapse all

    Divisor, specified as a quaternion object, an array of quaternion objects, a real numeric scalar, or an array of real numbers. Numeric values must be of data type single or double.

    At least one of A and B must a scalar.

    Dividend, specified as a quaternion object, an array of quaternion objects, a real numeric scalar, or an array of real numbers. Numeric values must be of data type single or double.

    At least one of A and B must a scalar.

    Output Arguments

    collapse all

    Result of quaternion left division, returned as a quaternion object or an array of quaternion objects.

    Algorithms

    collapse all

    Extended Capabilities

    expand all

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

    Version History

    Introduced in R2024a

    See Also

    Functions

    Objects