This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Shift, ShiftX, ShiftY, ShiftZ

Shift vector

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Value Summary

ShiftLibrary wrapper for “[ShiftX, ShiftY]” (2D), “[ShiftX, ShiftY, ShiftZ]” (3D)List of 2 or 3 expressions, depending on the dimension
ShiftX, ShiftY, ShiftZOptionalMuPAD® expression


Shift is the shift vector in transformation objects. ShiftX etc. refer to the single components of this vector.

The general transformation objects plot::Transform2d and plot::Transform3d allow to apply the affine-linear transformation to 2D and 3D objects, respectively. The shift vector b can be accessed and changed via the attribute Shift.

Special transformation objects such as plot::Translate2d, plot::Translate3d correspond to special matrices A and shifts b. They also allow to access and change the shift vector by the attribute Shift.

When setting the Shift attribute, matrices, arrays, and lists with 2 or 3 elements are accepted. Internally, however, the shift data are always stored as the list [b1, b2] in 2D or [b1, b2, b3] in 3D, respectively. When reading the vector by a slot access, this list is returned.

The entries of Shift can be animated.


Example 1

We move an arrow along the y-axis:

T := plot::Translate2d([0, a], a = 0..5,
                       plot::Arrow2d([0, 0], [1, 1])):

The Shift vector is the first argument in the call above. It is stored in the corresponding slot of the translation object T:


We change the shift vector:

T::Shift := [a, 0]:

delete T:

See Also

MuPAD Functions

Was this topic helpful?