discontinuous stairs graph plot
1 view (last 30 days)
Show older comments
Hello,
I would like to draw a graph using the discontinuous stairs where each point of the x axis represents a window. Each window starts as the following values:
Window_start=[ 1 416 496 497 702 703 704 707 739 740 742 743 1210 1574 1576 1583 1612 1650 1661 1687 2140 2236 2275 2470 2471]
and ends at the following values:
window_end=[1145 1170 1181 1184 1186 1195 1477 1480 1481 1500 1503 2082 2084 2086 2088 2098 2106 2112 2121 3186 3190 3198 3199 3202 4414]
The axis Y will be :
m_parameter= [2.06460150132812 2.02860836558769 2.01831024458700 2.00996892134879 2.08112665007345 2.08876924524156 2.05401823379362 2.04658117995847 2.05176206925603 2.05414798422655 2.05414624420764 2.06747745140798 2.07595643180192 2.04360793910280 2.04929503241671 2.05992930797909 2.04443363843455 2.05767243908497 2.04788211903293 2.02442415285694 2.04804646336094 2.05896936615501 2.05602938713115 2.00893004802126 2.00444396213057]
Does anyone have an idea obout how to do it? does the data in the axis x considered as category ?
0 Comments
Accepted Answer
Cris LaPierre
on 1 Jun 2021
I think the trick here is to realize that MATLAB will treat each column as a separate data series, so orgainze each step (start and stop X and Y values) into columns. Perhpas something like this.
Window_start=[ 1 416 496 497 702 703 704 707 739 740 742 743 1210 1574 1576 1583 1612 1650 1661 1687 2140 2236 2275 2470 2471];
window_end=[1145 1170 1181 1184 1186 1195 1477 1480 1481 1500 1503 2082 2084 2086 2088 2098 2106 2112 2121 3186 3190 3198 3199 3202 4414];
m_parameter= [2.06460150132812 2.02860836558769 2.01831024458700 2.00996892134879 2.08112665007345 2.08876924524156 2.05401823379362 2.04658117995847 2.05176206925603 2.05414798422655 2.05414624420764 2.06747745140798 2.07595643180192 2.04360793910280 2.04929503241671 2.05992930797909 2.04443363843455 2.05767243908497 2.04788211903293 2.02442415285694 2.04804646336094 2.05896936615501 2.05602938713115 2.00893004802126 2.00444396213057];
plot([Window_start;window_end],[m_parameter;m_parameter])
2 Comments
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D 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!