Clear Filters
Clear Filters

How to plot a graph like attached figure (in the form of steps).

1 view (last 30 days)
How can I plot my curve in the form of steps as given in the attached figure?

Accepted Answer

Star Strider
Star Strider on 29 May 2021
Use the stairs function.
Example —
y = linspace(0,10*pi);
x = sin(y)+1000;
figure
stairs(x, y)
xline(1000, '--')
xlim([998 1002])
.

More Answers (0)

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!