MATLAB: How to design a bump on the road as shown in the figure which is the input to the transfer function?. I had an input code for bump (half sine wave) which is r=0.1*sin(2*pi*20*t) ,what code need to be added into the same input as the flat road?

transfer function

r=0.1*sin(2*pi*20*t)

Best Answer

th = linspace(0,3*pi) ;
r=0.1*sin(th) ;
r(th>pi)=0 ;
plot(th,r,'linewidth',10)