peak average of consecutive values in a matrix array
显示 更早的评论
Hello, I would like to calculate the average of the peaks (positive and negative values) of consecutive values from a predifined number of elements from a Nx1 matrix, where N is the number of rows. For example, let's say I have a matrix with the following form (24x1):
A[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24]
I want to obtain the peak and the average for every 5 elements,
B=[mean(peak(1,2,3,4,5)); mean(peak((2,3,4,5,6)); mean(peak((3,4,5,6,7));...........mean(peak((20,21,22,23,24))]
I am chosing every 5 elements to simplify the example. But, this number number of elements can be higher than 100 and the points vary dramatically from positive to negative as they come from acceleration earthquake signals from N higher than 245000.
I would appreciate the help.
6 个评论
Dyuman Joshi
2023-7-19
Jorge Luis Paredes Estacio
2023-7-19
Dyuman Joshi
2023-7-19
"But peaks estimations involve as many peak values (positive or negative) not just one when using movmax."
Can you provide an example for this?
Jorge Luis Paredes Estacio
2023-7-19
Suppose this is the data in hand -
x = randi([-20 20],1,15)
Assume the moving window is 4, what should be the output in thise case? and what is the logic behind it?
Jorge Luis Paredes Estacio
2023-7-19
编辑:Jorge Luis Paredes Estacio
2023-7-19
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Descriptive Statistics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
