Main Content


Plot set of trajectories in trajectory plotter

Since R2021a



plotTrajectory(trajPlotter,trajCoordList) plots trajectories specified by trajCoordList via the trajectory plotter on a theater plot.


collapse all

Define the coordinates for three trajectories.

coordinates1 = [(1:10)' (2:11)' (11:-1:2)'];
coordinates2 = coordinates1 + 1;
coordinates3 = coordinates1 + 2;

Create a theaterPlot object, set the view angles, and create a trajectoryPlotter object.

tp = theaterPlot;
trajPlotter = trajectoryPlotter(tp,DisplayName="Trajectories");

Plot the three trajectories.


Input Arguments

collapse all

Trajectory plotter, specified as a trajectoryPlotter object.

Coordinates of the trajectories to show, specified as an N-element cell array, where N is the number of trajectories. Each cell element, representing a trajectory, contains an M-by-3 matrices, where M is the number of points in the trajectory. The matrices in different cells can have a different number of rows. The first, second, and third columns of each matrix correspond to the x-, y-, and z-coordinates of the corresponding trajectory.

Example: coordList = {[1 2 3; 4 5 6; 7,8,9];[4 2 1; 4 3 1];[4 4 4; 3 1 2; 9 9 9; 1 0 2]} specifies three different trajectories.

Version History

Introduced in R2021a