How to get the mean of a staircase graph?

2 次查看(过去 30 天)
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.

回答(1 个)

John D'Errico
John D'Errico 2022-2-8
编辑:John D'Errico 2022-2-8
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.

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by