How to get the mean of a staircase graph?

2 visualizaciones (últimos 30 días)
Sohel Rana
Sohel Rana el 8 de Feb. de 2022
Editada: John D'Errico el 8 de Feb. de 2022
I'm just wondering if it is possible to get the mean of a staircase graph where the values for y-axis are almost same. For example, I would like to find the mean value of y-axis data between two red dotted line (image below). I would like to get the mean where y-values are almost same. The data size is large and to get the mean value manually would be time consuming. I hope there is a way to find it out.

Respuestas (1)

John D'Errico
John D'Errico el 8 de Feb. de 2022
Editada: John D'Errico el 8 de Feb. de 2022
You don't give your actual data, just a pcture of it. Yes, sometimes a picture is worth a thousand words, but pictures are not worth a thousand numbers. :) A fellow named Mark may argue that point with me. :)
If I wanted to do this, I'd probably use a scheme where I would compute a moving estimate of the slope. Essentially, a variation of Savitsky-Golay filter would do. So at each point in the time series, I would implicitly fit a linear polynomial through the curve. Now I would look for the regions where the slope is uniformly small over a region. Then compute the mean over that interval.
No data, so no way to show you how to do it on your data. Yes. I could make up some data. Do I really want to think? Nah.

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by