plotTrackLog
Description
plotTrackLog(___, specifies
the reference frame used to interpret the coordinates of the tracks.frame)
plotTrackLog(___,
specifies options using one or more name-value arguments. For example,
Name=Value)plotTrackLog(viewer,tracklog,LineWidth=2) specifies the width of the
track trajectory line as 2.
Examples
Create a trackingGlobeViewer object and set its reference location. Also, set the camera view.
viewer = trackingGlobeViewer(BaseMap="darkwater",ReferenceLocation=[42.366978 -71.022362 50]);
campos(viewer,[42.3670 -71.0220 110]);Create a track log that contains five tracks.
tracklog1 = cell(1,5); for t = 1:5 tracklog1{t} = objectTrack(State=[0 0 t*10 0 0 0],UpdateTime=t); end
Plot the track log on the globe viewer.
plotTrackLog(viewer,tracklog1,FontSize=12);
Take a snapshot and show the results.
drawnow snapshot(viewer)
![]()
Create a second log of tracks.
tracklog2 = cell(1,5); for t = 1:t tracklog2{t} = objectTrack(State=[10 0 t*10 0 0 0],UpdateTime=t,TrackID=2); end
Plot the second log and only show the labels of the first and last tracks.
sampleTimes = [tracklog2{1}.UpdateTime tracklog2{end}.UpdateTime];
plotTrackLog(viewer,tracklog2,LabelSampling=sampleTimes,FontSize=14);Take a snapshot and show the results.
drawnow snapshot(viewer)
![]()
Plot the first and second logs together on the globe viewer.
tracklogs = [tracklog1{:} tracklog2{:}];
plotTrackLog(viewer,tracklogs,LabelSampling=sampleTimes,FontSize=14);Take a snapshot and show the results.
drawnow snapshot(viewer)
![]()
Input Arguments
Tracking globe viewer, specified as a trackingGlobeViewer object.1
Log of tracks, specified as an array or cell array of objectTrack objects, or as an
array or cell array of structures containing sufficient information to obtain the track
position information. For a sample track structure, see toStruct.
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.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
Example: plotTrackLog(viewer,tracklog,LineWidth=2)
Since R2026a
Color of detections, specified as:
"Auto"— Automatically select the color from a limited set of colors.A 1-by-3 RGB triplet — Plot all track logs with the same color.
Since R2026a
Label sampling mode, specified as "Timestamp",
"IndexSpacing", or"CustomIndices".
LabelSamplingMode determines how
plotTrackLog interpret the LabelSampling
argument.
LabelSamplingMode | How to Specify LabelSampling | Description |
|---|---|---|
"Timestamp" | Vector of nonnegative scalars of time values | Samples at specified times. Each value must match the
UpdateTime property of at least one track in the
tracklog input. |
"IndexSpacing" | Positive integer, N | Samples every Nth step. |
"CustomIndices" | Vector of positive integers | Samples at the specified indices. The function samples at each index listed in the vector. |
Label sampling, specified as a vector of nonnegative scalars, a positive integer,
or a vector of positive integers. This argument depends on the
LabelSamplingMode argument.
LabelSamplingMode | How to Specify LabelSampling | Description |
|---|---|---|
"Timestamp" | Vector of nonnegative scalars of time values | Samples at specified times. Each value must match the
UpdateTime property of at least one track in the
tracklog input. |
"IndexSpacing" | Positive integer, N | Samples every Nth step. |
"CustomIndices" | Vector of positive integers | Samples at the specified indices. The function samples at each index listed in the vector. |
Position selector, specified as an M-by-N
matrix of 0s and 1s, where M
is the dimension of the position state and N is the dimension of
the track state. The selector selects the position state from the track state by
premultiplying the track state. The default value [1 0 0 0 0 0 ; 0 0 1 0 0 0;
0 0 0 0 1 0] selects [x; y;
z] from a six-dimensional state [x;
vx; y;
vy; z;
vz]. You can also specify the position
selector as a character vector or string scalar of motion model name, such as
"constvel", "constacc",
"singer", "constturn", or
"ctrv". See getTrackPositions for more details.
Data Types: single | double
Font size of the track labels, specified as a positive scalar in point units. One point equals 1/72 inch.
Example: 11
Data Types: single | double
Line width of the track trajectory line, specified as a nonnegative scalar in point units, where 1 point = 1/72 of an inch.
Tip
If you specify the line width as 0, then the plot does not
show the trajectory line.
Example: 2
Version History
Introduced in R2023bYou can use the Color name-value argument to customize track log
color.
You can use the LabelSamplingMode name-value argument to customize
label sampling mode.
See Also
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®.
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)