Average of a each vertical section of a stepped sawtooth wave
2 次查看(过去 30 天)
显示 更早的评论
Hello everyone. I need a help to find the average of each vertical steps in a stepped sawtooth wave. For clarity, I have attached the figure of sawtooth wave. Just to reiterate how can I find the average of each small vertical steps in the attached stepped sawtooth wave? Thank you for the help in advance.
0 个评论
采纳的回答
Matt J
2021-3-25
I would fit a line to the steps with polyfit, then find the intersections of the line fit with the vertical edges.
更多回答(1 个)
Greg Dionne
2021-3-25
If you have the Signal Processing Toolbox, FINDCHANGEPTS is worth a look (it will give you the indices of each step of which you can take the average later -- see https://www.mathworks.com/matlabcentral/answers/313651-additional-findchangepts-function-output?s_tid=srchtitle for an example on how to extract each mean).
2 个评论
Greg Dionne
2021-3-25
The example in "help findchangepts" should hopefully get you started.
If you post your data though, maybe another volunteer can come up with something even better!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!