Main Content


Extract translation vector


    translationVector = trvec(transformation) extracts the translation vector translationVector of the SE(2) or SE(3) transformation transformation.

    Input Arguments

    collapse all

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

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

    Output Arguments

    collapse all

    Translation vector, returned as an M-by-2 matrix for se2 objects or an M-by-3 matrix for se3 objects. M is the total number of transformations, and each row is a translation vector in the form [X Y] for 2-D transformations or [X Y Z] for 3-D transformations.

    Extended Capabilities

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

    Version History

    Introduced in R2022b

    See Also