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!
