MATLAB: Need help making a stairs graph

graphstairs

Hi can anyone tell me how to make a stair graph? For example, I have two y values, the fist is 3 when x is from 0 to 4, the second is -3 when x is from 4 to 8.
Since the total length is 8, I put
x=8;
y=??;
but what do I need to put for y? when there are two difference values but I need them on the same graph.
stairs(x,y)
Best Regards
Samious

Best Answer

Try this:
x = 0 : 8
y = [3,3,3,3, -3,-3,-3,-3,-3];
stairs(x, y, 'bo-', 'LineWidth', 3);
ylim([-4, 4]);
grid on;