%% Create and Display Labeled Tracks on Bird's-Eye Plot
% Create a bird's-eye plot with an x-axis range from 0 to 90 meters and a y-axis range from –35 to 35 meters. Create a track plotter that displays up to seven history values for each track and offsets labels by 3 meters in front of the tracks.

bep = birdsEyePlot('XLim',[0 90],'YLim',[-35 35]);
tPlotter = trackPlotter(bep,'DisplayName','Tracks','HistoryDepth',7,'LabelOffset',[3 0]);

%
% Set the positions and velocities of three labeled tracks.

positions = [30, 5; 30, 5; 30, 5];
velocities = [3, 0; 3, 2; 3, -3];
labels = {'T1','T2','T3'};

%
% Display the tracks for 10 trials. The bird's-eye plot shows the seven history values specified previously.

for i=1:10
   plotTrack(tPlotter,positions,velocities,labels);
   positions = positions + velocities;
end

% Copyright 2012 The MathWorks, Inc.