# plotOrientation

Plot set of orientations in orientation plotter

## Syntax

``plotOrientation(oPlotter,orientations)``
``plotOrientation(oPlotter,roll,pitch,yaw)``
``plotOrientation(oPlotter,___,positions)``
``plotOrientation(oPlotter,___,positions,labels)``

## Description

example

````plotOrientation(oPlotter,orientations)` specifies the orientations of M objects to show for the orientation plotter, `oPlotter`. The `orientations` argument can be either an M-by-1 array of quaternions, or a 3-by-3-by-M array of rotation matrices.```
````plotOrientation(oPlotter,roll,pitch,yaw)` specifies the orientations of M objects to show for the orientation plotter, `oPlotter`. The arguments `roll`, `pitch`, and `yaw` are M-by-1 vectors measured in degrees.```
````plotOrientation(oPlotter,___,positions)` also specifies the positions of the objects as an M-by-3 matrix. Each column of `positions` corresponds to the x-, y-, and z-coordinates of the object locations, respectively.```
````plotOrientation(oPlotter,___,positions,labels)` also specifies the labels as an M-by-1 cell array of character vectors that correspond to the M orientations.```

## Examples

collapse all

Create a theater plot object and a trajectory plotter.

```tp = theaterPlot('XLimit',[-2 2],'YLimit',[-2 2],'ZLimit',[-2 2]); op = orientationPlotter(tp,'DisplayName','Orientation',... 'LocalAxesLength',2);```

Create some random rotations.

`pose = randrot(20,1);`

Loop through the pose information to animate the orientations.

```for i=1:numel(pose) plotOrientation(op,pose(i)) drawnow end``` ## Input Arguments

collapse all

Orientation plotter, specified as an `orientationPlotter` object.

Orientations of M objects, specified as either an M-by-1 array of quaternions, or a 3-by-3-by-M array of rotation matrices.

Roll, pitch, and yaw angles defining the orientations of M objects, specified as M-by-1 vectors. Angles are measured in degrees.

Object positions, specified as an M-by-3 real-valued matrix, where M is the number of objects. Each column of the matrix corresponds to the x-, y-, and z-coordinates of the objects locations in meters. The default value of `positions` is at the origin.

Object labels, specified as a M-by-1 cell array of character vectors, where M is the number of objects. `labels` contains the text labels corresponding to the M objects specified in `positions`. If `labels` is omitted, no labels are plotted.

## Version History

Introduced in R2021a