I want to create a stairs plot with solid horizontal lines and dashed vertical lines. You can see an example of what I am trying to do in this question (scroll down a little bit). In the example, however, they use Python, but I want to do this in MATLAB.
My (simple) code is
k=-4:1:4;
a= (2*k +1)/2;
t=-4:0.1:4;
figure()
stairs(k,a,'r')
hold on
plot(t,t)
I have no idea what to do. Any help is appreciated!

