Main Content


Plot platforms or targets in trackingGlobeViewer

Since R2021b



plotPlatform(viewer,platforms) plots tracking scenario platforms, specified as objects, on the tracking globe viewer.

plotPlatform(viewer,platStructs) plots tracking scenario platforms, specified as structures, on the tracking globe viewer.

plotPlatform(viewer,platStructs,frame) specifies the reference frame used to interpret the Position field of the platform structures platStructs.

plotPlatform(___,Name=Value) specifies options using one or more name-value arguments. For example, plotplatform(viewer,platforms,TrajectoryMode="History") specifies the trajectory plotting mode as "History".


collapse all

Create a trackingGlobeViewer with a specified reference location.

refloc = [42.366978 -71.022362 50];
viewer = trackingGlobeViewer(ReferenceLocation=refloc);

Adjust the camera position and orientation for visualization.

campos(viewer,refloc + [.02 .02 820]);
camorient(viewer,[210 -9 0]);

Create a tracking scenario and add two platforms. The first platform has an associated waypoint trajectory.

s = trackingScenario;
p1 = platform(s,'Trajectory',waypointTrajectory([0 0 0; 0 100 -100; 0 200 -500],[0 60 120]));
p2 = platform(s,'Position',[100 100 0]);

Plot the two platforms on the virtual globe.

hold on
plotPlatform(viewer,p2,Marker="d",Color=[1 0 0]);

Show the snapshot of the globe.


Input Arguments

collapse all

Tracking globe viewer, specified as a trackingGlobeViewer object.1

Tracking scenario platforms, specified as an array of Platform objects. You can create a platform in a tracking scenario using the platform object function.

Platform structures, specified as an array of structures. Each structure must contain at least these fields:

Field NameDescription

Position of the platform, specified as a three-element real-valued vector. Specify the position in the form [x, y, z], in meters, in your specified reference frame.

PlatformIDUnique platform identifier, specified as a positive integer.

Reference frame, specified as "NED" for north-east down, "ENU" for east-north-up, or "ECEF" for Earth-centered-Earth-fixed. When specified as "NED" or "ENU", the origin of the reference frame is at the location specified by the ReferenceLocation property of the viewer object.

Data Types: char | string

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.

Example: plotPlatform(viewer,platforms,TrajectoryMode="History")

Display mode for platform trajectories, specified as "History", "Full", or "None".

  • "History" — The viewer displays the past platform positions from the previous calls to the plotPlatform function. The maximum number of displayed history positions is specified by the PlatformHistoryDepth property of the viewer.

  • "Full" — Displays the entire platform trajectory, including the future platform positions.

  • "None" — Does not display any platform trajectory information.

Data Types: char | string

Marker symbol, specified as "^" for a triangle marker, "d" for a diamond marker, or "s" for a square marker.

Data Types: char | string

Width of the trajectory line, specified as a positive value in points, where 1 point = 1/72 of an inch. The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.

Color of trajectory line, specified as

  • A triplet — Plot all the trajectories with the same color.

  • An N-by-3 matrix of RGB triplets — Plot each trajectory line with a different color. N is the number of platforms plotted.

Platform label style, specified as one of these options:

  • "ID" — The function displays the platform label as platform ID and source index (if any).

  • "None" — The function does not display any platform label.

Data Types: char | string

Version History

Introduced in R2021b

expand all

1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.