How to get the mean of a staircase graph?
조회 수: 5 (최근 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/887785/image.jpeg)
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!