findextrema.m

Finds minima and maxima of data.

您现在正在关注此提交

FINDEXTREMA - finds minima and maxima of data

If 'y' is the data the function finds the maximas 'ma' and minimas 'mi'.
The x-position of the extrema are interpolated.

Usage: [ma,mi]=findextrema(y);

Example:
x=-10:0.1:10; y=sin(x);
[ma,mi]=findextrema(y);
plot(y); hold on; plot(ma,y(round(ma)),'ro'); plot(mi,y(round(mi)),'gs'); hold off;

引用格式

Schuberth Schuberth (2026). findextrema.m (https://ww2.mathworks.cn/matlabcentral/fileexchange/3586-findextrema-m), MATLAB Central File Exchange. 检索时间: .

类别

Help CenterMATLAB Answers 中查找有关 Interpolation 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.0.0.0