Aufgabe 2

t = 0:10:60;
sA = [0 0 50 50 60 60 60];
sB = [-30 -30 -40 -40 -10 -10 -10];
sC = [-10 -10 -10 -10 -10 80 80];
plot(t,sA); hold on;
plot(t,sB);
plot(t,sC); grid on;

Geschwindigkeit

vA = diff(sA) / 10
vA = 1×6
0 5 0 1 0 0
vB = diff(sB) / 10
vB = 1×6
0 -1 0 3 0 0
vC = diff(sC) / 10
vC = 1×6
0 0 0 0 9 0
mean(vA)
ans = 1
mean(vB)
ans = 0.3333
mean(vC)
ans = 1.5000