plotTransforms
Plot 3-D transforms from translations and rotations
Syntax
Description
draws transform frames in a 3-D figure window using the specified translations
ax
= plotTransforms(translations
,rotations
)translations
, and rotations, rotations
. The
z-axis always points upward.
draws transform frames for the specified SE(2) or SE(3) transformations,
ax
= plotTransforms(transformations
)transformations
.
specifies additional options using name-value arguments. Specify multiple name-value
arguments to set multiple options.ax
= plotTransforms(___,Name,Value
)
Input Arguments
translations
— xyz-positions
[x y z]
vector | matrix of [x y z]
vectors
xyz-positions specified as a vector or matrix of [x y
z]
vectors. Each row represents a new frame to plot with a corresponding
orientation in rotations
.
Example: [1 1 1; 2 2 2]
rotations
— Rotations of xyz-positions
quaternion
array | matrix of [w x y z]
quaternion vectors | N-element array of so2
or so3
objects
Rotations of xyz-positions specified as a quaternion
array,
N-by-4 matrix of [w x y z]
quaternion vectors,
or an N-element array of so2
or so3
objects.
N is the total number of rotations, and each element of the array,
each row of the matrix or rotation transformation objects represent the rotation of the
xyz-positions specified in
translations
.
If rotations
is an N-element array of
so2
or so3
objects, each element must be of the same
type.
Example: [1 1 1 0; 1 3 5 0]
transformations
— Transformation
se2
object | se3
object | M-element array of se2
or se3
objects
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'FrameSize',5
FrameSize
— Size of frames and attached meshes
positive numeric scalar
Size of frame and attached meshes, specified as positive numeric scalar.
FrameColor
— Color of frames
"rgb"
(default) | RGB triplet | string scalar
Color of frames, specified as an RGB triplet or string scalar.
Example: [0 0 1]
or "green"
FrameAxisLabels
— xyz labels of coordinate frame
"off"
(default) | "on"
xyz labels of the coordinate frame, specified as
"off"
to hide the labels or "on"
to show the
labels.
FrameLabel
— Frame labels
""
(default) | string
| N-element array of strings
Frame labels, specified as a string or N-element array of
strings, where N is the total number of frames and each string
corresponds to one frame at the same index of transformations
,
translations
, or rotations
.
AxisLabels
— xyz labels of plotting axes
"off"
(default) | "on"
xyz labels of the plotting axes, specified as
"off"
to hide the labels or "on"
to show the
labels.
InertialZDirection
— Direction of positive z-axis of inertial frame
"up"
(default) | "down"
Direction of the positive z-axis of inertial frame, specified
as either "up"
or "down"
. In the plot, the
positive z-axis always points up.
MeshFilePath
— File path of mesh file attached to frames
character vector | string scalar
File path of mesh file attached to frames, specified as either a character vector
or string scalar. The mesh is attached to each plotted frame at the specified position
and orientation. Provided .stl
are
"fixedwing.stl"
"multirotor.stl"
"groundvehicle.stl"
Example: 'fixedwing.stl'
MeshColor
— Color of attached mesh
"red"
(default) | RGB triplet | string scalar
Color of attached mesh, specified as an RGB triplet or string scalar.
Example: [0 0 1]
or "green"
View
— Plot view
"3D"
(default) | "2D"
| three-element vector
Plot view, specified as "3D"
, "2D"
, or a
three-element vector of the form
[x,y,z] that sets the view
angle in Cartesian coordinates. The magnitude of
x,y, and z are
ignored.
Output Arguments
Version History
Introduced in R2018b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)