Filter löschen
Filter löschen

Plotting Data Points with Lines to Indicate Unchanging Conditions Over Time

3 Ansichten (letzte 30 Tage)
I wish to plot a time series for some data that has horizontal/vertical lines connecting them to indicate that once a value was selected, it remains constant over time until the next point is selected. I thought of one way to do this, but it is extremely complicated and would take way more time than it's worth to implement. Does anyone know of a simple method to do this or maybe a Matlab plotting function that can do this?
Visual Example:
Left side: Data plotted Right side: Data plotted with connecting lines

Akzeptierte Antwort

William Rose
William Rose am 22 Feb. 2023
stairs(x,y)
I use it for heart rate data all the time, since, once you have a rate estimate from detecting the second R wave in a recording, you do not have another HR estimate until the next R wave is observed.
  4 Kommentare
Steven Lord
Steven Lord am 22 Feb. 2023
FYI, since I think a lot of users don't know about this, take a look at the Plots tab of the toolstrip. It shows small thumbnails of many of the different visualization functions in MathWorks products. If one looks similar to what you want you can see the name of the function used to create that type of plot under the thumbnail.
If you have selected a particular variable in the Workspace window you can even limit the plots shown to only those that can be created from that data and can click on the thumbnail to create a plot for that specific data.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by