peak average of consecutive values in a matrix array
Ältere Kommentare anzeigen
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 Kommentare
Dyuman Joshi
am 19 Jul. 2023
Jorge Luis Paredes Estacio
am 19 Jul. 2023
Dyuman Joshi
am 19 Jul. 2023
"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
am 19 Jul. 2023
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
am 19 Jul. 2023
Bearbeitet: Jorge Luis Paredes Estacio
am 19 Jul. 2023
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
