In Matlab, how can i have a slider which allows me to choose the time and respectively shows the right dd's coordinates. How can i codify uicontrol??

pitch = [0 67; 0 0; 104 67; 104 0; 0 67] %always the same values over the time
time=[1;2;3;4;5] %time in seconds
dd = [2 5; 6 9; 7 8; 9 10; 10 30] %displacement over the time
figure;
title ('posições defesas');
plot (pitch(:,1),pitch(:,2),'k');
hold on
axis equal
plot(dd(:,1),dd(:,2),'r');