Azzera filtri
Azzera filtri

Plot with intervals for x axis

2 visualizzazioni (ultimi 30 giorni)
Nethravathi S
Nethravathi S il 20 Giu 2020
Risposto: Tommy il 20 Giu 2020
I am plotting a graph with the following code:
P1=plot(x,poweachslot,'displayname','Load curve without DSM' );
hold on
P2=plot(x,poweachslot1,'displayname','Load curve with DSM' );
ylabel('power consumed')
title('Daily load curve')
hold off
This gives me a graph which is like joining the dots for each x value( not able to insert the graph)
How do I get a graph where from x=1-2, y=const1, x=2-3 y=const2 etc..

Risposte (1)

Tommy il 20 Giu 2020
I believe stairs() is what you want:


Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by