MATLAB: How to use multiple graphs such as insert step and step response in a graph as shown in image

plot

I am using this code
L=0:25;
T=[2 2.25 2.48 3.15 3.35 4.07 4.36 5.09 5.45 6.20 6.56 7.38 8.25 9.10 10.04 10.58 12.30 13.45 15.06 16.58 19.00 22.00 25.15 31.15 39.0 60.0];
plot(T,L);
grid;
Please suggest Regards MMS79

Best Answer

It looks as though your step input plot starts at the second value of your time vector and reached a value of 20 from there on, this works:
L=0:25;
T=[2 2.25 2.48 3.15 3.35 4.07 4.36 5.09 5.45 6.20 6.56 7.38 8.25 9.10 10.04 10.58 12.30 13.45 15.06 16.58 19.00 22.00 25.15 31.15 39.0 60.0];
S = [0 ones(1,size(L,2)-1)*20];
plot(T,L);
hold on
plot(T,S, '-k', 'LineWidth',2)
hold off
grid;