Finding maximum and minimum

1 Ansicht (letzte 30 Tage)
Tsvetan Donov
Tsvetan Donov am 10 Aug. 2016
Bearbeitet: Stephen23 am 10 Aug. 2016
Hi, I have a question regarding how to find all the maximums on the following graph, because it is not just one. It represents an earthquake shaking a building and the acceleration decreases by a certain amount of damping.
The time interval is not identical.

Antworten (1)

Stephen23
Stephen23 am 10 Aug. 2016
Bearbeitet: Stephen23 am 10 Aug. 2016
If you have the Signal Processing Toolbox then you can use findpeaks. To find the minima simply invert the data.
Otherwise search for "peaks" or "peak finder" on MATLAB File Exchange:
You might also be like to have a look at envelope fitting tools.
  2 Kommentare
Tsvetan Donov
Tsvetan Donov am 10 Aug. 2016
So I have named the x axis- Time and the y axis- Struc. I write: plot(Time, Struc) - this gives me the graph Then how do I use the findpeaks function?
Thanks!
Stephen23
Stephen23 am 10 Aug. 2016
Bearbeitet: Stephen23 am 10 Aug. 2016
@Tsvetan Donov: You should start by reading the findpeaks documentation. Why else do you think I gave you that link? The documentation explains what syntax is allowed, and has examples for you to try out! Probably you can simply call:
[pksMax,locsMax] = findpeaks(data) % maxima
[pksMin,locsMin] = findpeaks(-data) % minima

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by