Plot with step changes - no interpolation

97 views (last 30 days)
Hello,
The standard for plotting a line in matlab is that the line is drawn with a constant slope between the points. I would like to plot something where each subsequent y-value represents a step change in rate. The resulting plot would look blocky, rather than smoothed between the points. Any suggestions that will help me with this?
Thank you.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 4 Nov 2011
stairs(1:10)

More Answers (2)

Walter Roberson
Walter Roberson on 4 Nov 2011
Perhaps a stairs() plot ?

John
John on 4 Nov 2011
Thank you both.

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!