Main Content


Extract rotation matrix


    rotationMatrix = rotm(transformation) returns the rotation matrix rotationMatrix from the transformation transformation.

    Input Arguments

    collapse all

    Transformation, specified as an se2, se3, so2, or so3 object, or as an M-element array of transformation objects. M is the total number of transformations.

    If you specify transformation as an array, each element must be of the same type.

    Data Types: single | double

    Output Arguments

    collapse all

    Rotation matrix, returned as a 2-by-2-by-M array for 2-D transformations or a 3-by-3-by-M array for 3-D transformations. M is the total number of transformations.

    Extended Capabilities

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

    Version History

    Introduced in R2022b

    See Also