function changdu=h(t)
Lt=30;B=5;e=2;a=pi/30;w=20*pi;
r=Lt*tan(a)+e;
t=0:0.0001:0.1;
t1=asin(B/r)/w;
if 0<t<=t1;
f1=1;
else
if
t1=asin(B/r)/w;
t2=pi/w-t1;
t1<=t<=t2;
f1=2;
else
if
t1=asin(B/r)/w;
t2=pi/w-t1;
t3=pi/w+t1;
t2<=t<=pi/w;
f1=3;
else
if
t1=asin(B/r)/w;
t2=pi/w-t1;
t3=pi/w+t1;
t4=2*pi/w-t1;
t3<=t<=t4;
f1=4;
else
t1=asin(B/r)/w;
t2=pi/w-t1;
t3=pi/w+t1;
t4=2*pi/w-t1;
t4<=t<=2*pi/w;
f1=5;
end
end
end
end
plot(t,f1,'r');